manalnor Posted April 13, 2010 Share Posted April 13, 2010 Hello, If i have link like this site.com/index.php?r=$d then i re-write it to be site.com/$d and made .htaccess file RewriteRule ^(.*)/$ index.php?r=$1 why it isn't working, however it works fine only if i add .html as following site.com/$d.html and RewriteRule ^(.*)/.html$ index.php?r=$1 so how i can write it without .html at its end thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/198380-is-that-command-is-right/ Share on other sites More sharing options...
cags Posted April 14, 2010 Share Posted April 14, 2010 What is the URI that you are using to test your pattern? I can see a few potential problems depending on the exact URI used, but to be honest I can't understand why any of them would necessarily be fixed by using .html on the end of them. I would probably use a pattern something along the lines of... RewriteRule ^(.*)/?$ /index.php?r=$1 The only changes I have really made is to make the trailing slash on the input URI optional and to add in a 'root' base for the rewritten address. Quote Link to comment https://forums.phpfreaks.com/topic/198380-is-that-command-is-right/#findComment-1041539 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.