Forum Moderators: phranque
I want to redirect the following with a 301
[widgets.com...] to [widgets.com...]
[widgets.com...] to [widgets.com...]
[widgets.com.index.htm...] to [widgets.com...]
[widgets.com...] to [widgets.com...]
I got as far as this before giving up,
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.widgets\.com
RewriteRule (.*) [widgets.com...] [R=301,L]
rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+/)?index\.php\ http
rewriteRule ^(.+/)?index\.php$ [widgets.com...] [R=301,L]
Any help appreciated
RewriteEngine on
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.example.com/ [R=301,L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteRule ^([^/]+/)*index\.php$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Take care with upper/lowercase usage on Apache and *nix -- A major problem with your code was that 'http' would never match any client request, thus disabling that rule.
Jim
First of all the main thing i need to do is redirect [site.com...] to
[site.com...]
I placed the htaccess file in the forums directory & was able to make index.php redirect but not index.php?
My code if below,
RewriteEngine on
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php?\ HTTP/
RewriteRule ^index\.php?$ [site.com...] [R=301,L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php?\ HTTP/
RewriteRule ^([^/]+/)*index\.php?$ [site.com...] [R=301,L]
Any help really appreciated because i have a serious duplication URL issue that has blasted my forums out of the index... + i am not able to find all the ways in vbulletin to stop it linking to index.php?
Thanks...
The following should work better:
RewriteEngine on
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.p[b]hp[^\ ]*\[/b] HTTP/
RewriteRule ^index\.p[b]hp$[/b] http://www.example.com/foru[b]ms/[/b] [R=301,L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.p[b]hp[^\ ]*\[/b] HTTP/
RewriteRule ^([^/]+/)*index\.p[b]hp$[/b] http://www.example.com/foru[b]ms/[/b]$1 [R=301,L]
That's one of the main reasons we get so many of these threads... ;)
For more information on mod_rewrite and regular expressions, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
www.site.com/forums/index.php to www.site.com/forums/ works.
www.site.com/forums/index.php? to www.site.com/forums/ does not work...
Instead it redirects to www.site.com/forums/?
With the? on the redirection destination.
Any more ideas?
Sorry to be a pain but i am not technical enough to work this out & currently i have lost all traffic to my forums...
I must get rid of this duplication.
Any help appreciated
Do the directives
RewriteEngine on
#
RewriteCond %{HTTP_HOST}!^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
worked to you?
They do not for me. I`m following up your discussion. May you or somebody else help me?
My sites are hosted in a Unix virtual server, on an unique IP and different domains names of my own. I also use Webmin. The help sent by the support of my server didn`t worthy.
The Apache directives in /usr/local/apache/htdocs/imanager/.htaccess are:
Options FollowSymLinks ExecCGI
AddType application/x-httpd-cgi .cgi
DirectoryIndex index.cgi
<Limit GET POST>
allow from all
</Limit>
And I used the directives from your firts message on root of each site.
In addition, I`d like to solve the problem to all sites on the server, instead site after site. Is there a solution? The directives for the IP address are:
SSLDisable
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteOptions inherit
</IfModule>
On the end, I`m interested also to follow up your discussion about forum.php because I`ll begin to run my forum on the next days.
Thanks in advance,
rmiranda
RewriteEngine on
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php[^\ ]*\ HTTP/
RewriteRule ^index\.php$ http://www.example.com/forum[b]s/?[/b] [R=301,L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php[^\ ]*\ HTTP/
RewriteRule ^([^/]+/)*index\.php$ http://www.example.com/forums/[b]$1?[/b] [R=301,L]