| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| HTTP Status Codes in .htaccess | |
|---|---|
| Tweet Topic Started: Jun 24 2005, 04:21 PM (1,755 Views) | |
| Ben | Jun 24 2005, 04:21 PM Post #1 |
|
Quantum-locked when observed.
![]()
|
I'm wondering how one would send an HTTP status code through a .htaccess file (or if it is even possible). I have a file located at policies.php. For the sake of using friendly URIs, I have used mod_rewrite in my .htaccess file to redirect "sitename/policy/" to policies.php. Now, however, I want to change that so mod_rewrite will redirect "sitename/fleetlaw/" to policies.php. Now, I know that I can set that up easily without doing anything else. However, I'd like to also set it up so when a client accesses "sitename/policy/" they will be directed to policies.php and get a 301 (Moved Permanently) status code. Is there some way to do this in .htaccess? I'm thinking putting something in:
I'm just not sure what sort of code would accomplish my objective (to generate a 301 HTTP Status code). |
![]() |
|
| Stefan | Jun 24 2005, 04:32 PM Post #2 |
![]()
Mew?
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Redirect permanent sitename/policy/ http://host.com/path_to/policy.php might work, unless you mean your domain by "sitename", then it's Redirect permanent /policy/ http://host.com/path_to/policy.php http://httpd.apache.org/docs-2.0/mod/mod_alias.html#redirect
|
![]() |
|
| Ben | Jun 24 2005, 04:35 PM Post #3 |
|
Quantum-locked when observed.
![]()
|
Ah-hah, that looks good. Thanks.
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
6:35 AM Jul 11
|








![]](../../../../0/1/0/p601690/pipright.png)
6:35 AM Jul 11