Hi,
I have been reading about URL rewriting and mod_rewrite for a while but it seems I cannot make it work as I want. Here is my website I am working on:
On this site I have different type of pages such as page.php, tutorial.php, post.php and category.php. Here is how the URLs are at the moment:
Code:
configureweb.com/page.php?page=about
configureweb.com/tutorial.php?tutorial=html-tutorial
configureweb.com/post.php?post=sample-post
configureweb.com/category.php?category=hosting-and-domains
and here is how I want them to be:
Code:
configureweb.com/page/about
configureweb.com/tutorial/html-tutorial
configureweb.com/post/sample-post
configureweb.com/category/hosting-and-domains
I tried something like the following code for pages:
Code:
RewriteRule ^page/([A-Za-z0-9-]+)/?$ page.php?page=$1 [L]
Code:
<a href="page/about">About</a>
It redirects to the correct page but the stylesheet is not active and links on that page become like this:
Code:
configureweb.com/page/page/about/
What am I doing wrong?
|