Jump to content

Recommended Posts

So I have three things I am trying to accomplish in my .htaccess file (at the moment). I am trying to:

 

 

1) Redirect anything from the non-'www' domain to the www domain

2) process html files as php

3) Set up a 301 redirect for some files that have been renamed and moved to other directories

 

The first two have worked without any troubles up until now. Where I am having the problem is in the 301 redirect I have created. I am using the following code (in my root directory .htaccess file)

 

RewriteRule /access/index.htm$ http://www.site.com/school_info/map.html [R=301]

 

The problem is that it will only forward

 

site.com/access/index.htm

 

It will not forward

 

www.site.com/access/index.htm

 

How can I get it to also forward the www version of the page?

 

Here is my entire .htaccess file if necessary:

 

RewriteEngine on
RewriteRule /access/index.htm$ http://www.site.com/school_info/map.html [R=301]

Options +FollowSymlinks
rewritecond %{http_host} ^site.com [nc]
rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc]

AddHandler application/x-httpd-php .html

Link to comment
https://forums.phpfreaks.com/topic/109674-301-redirect-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.