.htaccess configuration for SEO Frendly URLs

Discussion in 'Search Engine Optimization' started by infinity79, Oct 25, 2014.

  1. #1
    I need some suggestions on how to create a htaccess file for the following issue:
    I have a Romanian dictionary site: http://www.toatecuvintele.ro/ that gets the definition of a word through definitie.php with two parameters cuvant and forma. I have managed to transform via htaccess the link http://www.toatecuvintele.ro/ definitie.php?cuvant=test&forma=cuvant to http://www.toatecuvintele.ro/cuvant/test, but here it comes the challenge:
    Recently I have added an English dictionary database for which I have created a subdomain: http://engleza.toatecuvintele.ro/. Here the definition is returned via definition.php with the same two parameters: cuvant and forma I would like to change the htaccess so that http://engleza.toatecuvintele.ro/definition.php?cuvant=boss&forma=cuvant would automatically redirect to http://engleza.toatecuvintele.ro/cuvant/boss without, of course, affecting my root dictionary.

    My htaccess file looks like this:

    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/]+)/([^/]*)/?$ definitie.php?forma=$1&cuvant=$2 [L,QSA]

    RewriteCond %{HTTP_HOST} ^toatecuvintele\.ro$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.toatecuvintele\.ro$
    RewriteRule ^index\.php$ "http\:\/\/www\.toatecuvintele\.ro\/" [R=301,L]

    RewriteCond %{HTTP_HOST} ^toatecuvintele.ro$
    RewriteRule ^/?$ "http\:\/\/www\.toatecuvintele\.ro\/" [R=301,L]

    Any hint would be highly appreciated.
     
    infinity79, Oct 25, 2014 IP
  2. FPForum

    FPForum Notable Member

    Messages:
    4,172
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    225
    Digital Goods:
    2
    #2
    FPForum, Jan 1, 2015 IP