Forum Moderators: phranque
i have the following lines in my htaccess
RewriteEngine on
Options +FollowSymLinks
RewriteRule ^kj/([a-zA-Z0-9]+)/$ /kj/demo.php [L]
It is supposed to rewrite a url like /kj/variable/ to /kj/demo.php
It is working when i put 'variable' to anything other than 'demo'. But it stops working when i put 'variable' to 'demo'.
i have searched the set and have not found any answer yet.
Any help will be greatly appreciated.
thanks in advance.
So it is possible that whatever mechanism you are using to "GET" that URL-path-part within your script is failing because it sees its own name as the GET value.
Typically, such rules are written to explicitly pass the requested path to the script. Example:
RewriteRule ^kj/([a-zA-Z0-9]+)/$ /kj/demo.php?mypath=$1 [L]
You can verify this as the problem by using a rule similar to what I posted, disabling AcceptPathInfo, and modifying your script to take the path-info it needs from the GET parameter "mypath".
Regardless of server version, this problem might also be caused by having MultiViews enabled. If you don't use MultiViews, turn them off (Options +FollowSymLinks -MultiViews).
Jim