.htaccess simple redirect question
Hi,
I want to set up a link on my wordpress site to redirect all incoming traffic to a (non-existent) url, so it goes to a real url.
I want to this:
http://mysite.com/myproduct/
to redirect to:
http://mysite.com/index.php/myproduct/
I want to do this with a .htaccess file.
How do I do it and is there a log I can view when testing it?
5 Replies
What you want is not a redirect. You want a "rewrite". Check out the documentation for mod_rewrite:
https://www.hostgator.com/help/article/apache-mod-rewrite-and-examples
https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite
https://code.tutsplus.com/tutorials/an-in-depth-guide-to-mod_rewrite-for-apache--net-6708
https://www.linuxquestions.org/questions/linux-server-73/how-to-log-apache-mod_rewrite-907238/
The last url in the list talks about how to log mod_rewrite actions.
-- sw
Why wouldn't a simple "redirect 301 " do the job?
I'm assuming myproduct is a placeholder…
-- sw