php - htaccess not working due to some mystical issue -
i'm running windows 7 xampp server
has apache
, has lines needed uncomment work fine.
however when try use rewriterule
bump problem.
when write wrong code @ start of htaccess throws error 500, there few commands works, when use rewriterule ignore part , unless if write syntax wise wrong reacts error, have never seen link changed.
.htaccess file placed @ mydomain directory
can possibly issue of software or it's code?
i have dynamic link:
http://localhost//mydomain/folder/ad.php?title=thetitle&id=1
and need this:
http://localhost//mydomain/folder/thetitle/1
my htaccess file looks this:
rewriteengine on rewritebase /mydomain/folder rewritecond %{request_uri} ^/ad.php$ [nc] rewritecond %{query_string} ^title=(.*)&id=(.*)$ rewriterule (.*) http://localhost/mydomain/folder/%1/%2.aspx? [r=301,l]
any highly honored :)
you can have these rules in /mydomain/folder/.htaccess
:
rewriteengine on rewritebase /mydomain/folder/ rewritecond %{the_request} /ad\.php\?title=([^\s&]+)&id=([^\s&]+) [nc] rewriterule ^ %1/%2? [r=302,l] rewriterule ^([^/.]+)/([0-9]+)/?$ ad.php?title=$1&id=$2 [l,qsa]
Comments
Post a Comment