: How do I make SEO friendly URLs from my PHP pages? I'm pretty new to this and was wondering how to turn my site URLs into SEO friendly URLs using .htaccess and mod_rewrite? My URLs take
I'm pretty new to this and was wondering how to turn my site URLs into SEO friendly URLs using .htaccess and mod_rewrite?
My URLs take the form mydomain.com/index.php?pid=1&pagename=Some Page
I would like it be mydomain.com/Some Page
OR
mydomain.com/somepage.html
I know this is possible with mod_rewrite and .htaccess, but I'm having trouble finding an exact answer on how to accomplish this?
More posts by @Hamaas447
1 Comments
Sorted by latest first Latest Oldest Best
You can find many tutos when you are searching over the web (or even more specifically on www.stackoverflow.com).
For instance, you can find this good tutorial.
Namely, you have to use conditions RewriteCond (one or more) and then add the rewriting you want to do with RewriteRule.
For instance, let say you want to redirect users to another domain (this is a dummy example, there are probably better ways to handle this):
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{REQUEST_URI} !^/HTML2/
RewriteRule ^(.*)$ /HTML2/
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.