• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 473
  • Last Modified:

Apache Redirect URL

How can I configure apache to redirect a site from using www.website.com/nomad/index.php to www.website.com.  This is the routing of the webapp, so I am hoping I can configure a redirect in Apache.
0
Jack_son_
Asked:
Jack_son_
  • 2
3 Solutions
 
Steve BinkCommented:
RewriteRule ^/?$ /nomad/index.php [QSA,R]

This rule should be placed in the site's virtual host container in the server's conf files, or in an .htaccess file in the root directory of the site.  You will also need to make sure mod_rewrite is loaded and turned on for the site in question.

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
0
 
ahoffmannCommented:
hmm, I assume it's the other way around:

 RewriteRule ^/nomad/index.php / [QSA,R]
0
 
Steve BinkCommented:
Yeah, depending on interpretation.  Do you want requests to the root to go to the app, or do you want requests to the app to "look" like requests to the root?

One of those two will work for sure, though.
0
 
Jack_son_Author Commented:
I need them to go to a subdirectory; using an mvc, so I just want to redirect right to the home page, like in IIS, although have not done it in Apache
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now