Forum Moderators: phranque
i'm using a simple mod_rewrite script to get started with.
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule test/(.*)$ test.php?a=$1
now with this i assume if i put "www.site.com/test/something/"
in my address bar i must get a variable "a" on page "test.php" with a value of "something". but when I put this url in the address bar i get "page cannot be displayed error".
can anyone please have a look
thanks
What does your error log contain after you test this code?
The code itself looks OK, but you may need to change your AllowOverride settings. Also, if there is an existing subdirectory named "test", then you may need to add the directive "RewriteOptions inherit" to the .htaccess file in that subdirectory.
Jim
I have given up the whole idea of writing mod-rewrite conditions for mysite. I am gonna do it through php but i still need a url rewrite script that sends all the requests to one php script
so if i click on this link
<a href="category1/category2/">Category2</a>
the mod_rewrite must write it to this
mysite.com/show.php?q=category1/category2/
i am using this simple script but i keep getting "page not found error"
<Directory />
AllowOverride All
</Directory>
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule /(.*)$ show.php?q=$1
Thanks
zeeshan