Mobile app version of vmapp.org
Login or Join
Odierno851

: RewriteRule working local but not on remote server I have a .htaccess file with one simple RewriteRule: RewriteEngine on RewriteRule ^([A-Za-z0-9-]+)$ ?site= I want to have an url like http://www.example.com/imprint

@Odierno851

Posted in: #Htaccess #ModRewrite

I have a .htaccess file with one simple RewriteRule:

RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)$ ?site=


I want to have an url like www.example.com/imprint and forward it to www.example.com/?site=imprint
I checked this rule with an RewriteRule tester which gave me the results I want to achieve. On my local development system it works well too.

But on a remote server the URLs just give me a 404 error. Other more simple rewrite rules are working with no problems, so everything must be set up correctly (I think..). The problem is that I don't have access to any error logs or the server configs. So the only thing I can do is to guess...

Can anyone tell me if theres something wrong with this rule? Or anything else I can do or test to solve this? Or has someone an idea what could be wrong on the server?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Odierno851

1 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

Try slash before the ?, like

RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)$ /?site=


If that doesnt work, try adding [R] after so it will actually rewrite the url and you can see where it goes in your browser url bar

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme