: Re-write contact-us as contactUS.php. Redirect contactUS.php to contact-us. Edit: Redirects and rewrites are 2 different things. In a redirect, the URL change happens client-side. In a rewrite,
Re-write contact-us as contactUS.php.
Redirect contactUS.php to contact-us.
Edit:
Redirects and rewrites are 2 different things. In a redirect, the URL change happens client-side. In a rewrite, the URL change happens entirely server-side. I.e.:
Redirect
Client: GET /foo
Server: Location: /bar
Client: GET /bar
Server: [/bar]
Rewrite
Client: GET /foo
(Server: /foo --> /bar)
Server: [/bar]
So if you set up the above rewrite and redirect rules, the client will always navigate to /contact-us, while the server will always serve up /contactUS.php.
Edit2:
Sorry, I forgot to mention that mod_rewrite applies rewrite rules to internal requests as well as client requests. So you need to add a rewrite condition to the redirect to prevent this:
RewriteRule ^contact-us$ contactUS.php [L]
RewriteCond %{ENV:REDIRECT_STATUS} !=200
RewriteRule ^contactUS.php$ contact-us [R=301]
More posts by @Shanna517
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.