Forum Moderators: phranque

Message Too Old, No Replies

redirect success for all links to [www] ,except one subfolder? why?

         

fjoufi

2:36 am on Nov 3, 2009 (gmt 0)

10+ Year Member



Hi all,Can you help me on this , the root[http://mysite.com] --- to ---> [http://WWW.mysite.com] ---> successful!,what I did is creat a new .htaccess file ,and added [Options +FollowSymLinks] code into it [Options +FollowSymLinks]

[edited by: encyclo at 1:19 pm (utc) on Nov. 3, 2009]
[edit reason] fixed formatting error [/edit]

jdMorgan

2:10 pm on Nov 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your code as a basis for discussion. We can't help fix what we cannot see.

Please review our terms of service and our Forum Charter before posting the code.

We also need an example of what subfolders *are* beinf successfuly redirected, and which subfolder is not being redirected. .htaccess files are complex, and detailed information is required.

Thanks,
Jim

fjoufi

4:31 pm on Nov 3, 2009 (gmt 0)

10+ Year Member



I am sorry Jim for what happened. my problem is I successfully redirect mainpage and subfolers URL's to appear with www by creating an .htaccess file under the root with this code :

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
RewriteRule ^(.*)$ [mysite.com...] [R=301,L]

but one of these subfolder won't to redirect and still appear without www , because this subfolder is a separate script and has an .htaccess it's own for RewriteEngine to rewrite .php file to .html.

In .htaccess file of this subfolder I repeat the same code above, but did not succeed.!

so, how can I redirect this subfolder URL to apper with www same others ?

Thanks,
fjoufi

jdMorgan

4:48 pm on Nov 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We need to see the script subfolder code, then... and we still need to see an 'example URL' for the URL that is failing to redirect.

Two things you might want to check, since responses here may be slow:
Look at the

 RewriteOptions inherit 

directive and setting in the mod_rewrite documentation, and look at your server config file to determine if the script is 'Aliased' or 'ScriptAliased' (see Apache mod_alias docs). If the script is aliased, then that alias will likely take effect before any mod_rewrite processing can be done; you'll need to remove the alias or modify it (possibly replacing it with a new mod_rewrite rule and/or a symlink) to work with your mod_rewrite code as you desire it to.

Jim