Marco Gasi
asked on
.htaccess and SEO friendly urls
Hi everybody.
So I'm using a cde in .htaccess to remove php extension from the url:
Any idea about how can I remove the extension from the simple page and make dynamic urls seo friendly?
Thank you in advance for any suggestion :)
So I'm using a cde in .htaccess to remove php extension from the url:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} ^(.+)\.php$
RewriteRule (.*)\.php$ /$1 [R=301,L]
It works fine. But I have some dynamic url I want to make SEO compliant. For instance, I would like thatwines?wine=bordeaux
becomewines/bordeaux
So I looked around and I found this to put in my .htaccessRewriteCond %{THE_REQUEST} \s/vinos\.php\?v=(\w+)\s [NC]
RewriteRule ^ /vinos/%1? [R=301,L]
RewriteRule ^vinos/(\w+)$ /vinos.php?v=$1 [L]
With this the url is rewritten as expected but in the page which is open php just doesn't work. And all css is lost...Any idea about how can I remove the extension from the simple page and make dynamic urls seo friendly?
Thank you in advance for any suggestion :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks and thanks again :)
ASKER
No new question, I solved it by myself. I already thanked you? :D
ASKER
Thank you again.