Jump to content

is that command is right !


manalnor

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/198380-is-that-command-is-right/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.