Skip to content
Advertisement

Tag: mod-rewrite

RewriteCond works sometimes

This is my code on /etc/apache2/sites-enabled/dynamic-vhosts.conf: My problem is, in some cases it’s force to HTTPS, but in other cases it’s not. Example: On some desktops browsers, it’s redirect to HTTPS, but on mobile browsers or on others desktops/servers browsers, it’s not. Anybody can help me? Answer Try this, but I am not so sure that this will fix your

htaccess misconfiguration 500

So basically i created a .htaccess file which removes .html extension and redirects /file.html to /file but when i write /file.html/ it causes a 500 internal server error, How can I map/file.html/ to my custom error page ? or simply redirect that also to /file.html Here is the code : Answer With your shown samples, could you please try following(comments

.htaccess RewriteRule keeping URL structure

My current rewrite rule: The result above works great so I can format the URL like domain.com/a/b/c I would like to add in a domain switch as well so the results I want is sub.domain.com/a/b/c when you access it using domain.com/a/b/c Currently here is what I have tried But the result of this is http://sub.domain.com/a=a&v=b&id=c and needs to be http://sub.domain.com/a/b/c

Advertisement