Forum Moderators: phranque
#Options +FollowSymLinks
php_value error_reporting 1
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^website.com [NC]
RewriteRule ^(.*)$ http://www.website.com/$1 [L,R=301]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^website.com [NC]
RewriteRule ^(.*)$ https://www.website.com/$1 [L,R=301]
RewriteRule ^(.*)\/function\.mkdir$ /$1 [L,R=301]
RewriteRule ^google2a182b0273bc.html$ - [L]
RewriteRule ^google493735a2a7cd7.html$ - [L]
RewriteRule (.*)\.html$ $1.php [L]
RewriteRule (.*)sitemap\.xml$ sitemap_area.php [L]
RewriteRule api - [L]
RewriteRule ^(.*)\/$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . frontend/index.php [L]
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteRule ^[A-Z]{2}-.* /php/profile.php [L]
</IfModule>
#RedirectMatch 301 ^/(.*)\/$ /$1 You have mixed RewriteRule and Redirect/RedirectMatch directives in the same file.
Use RewriteRule for all of the rules.
Always include the target domain name in the rule when you have an external redirect.
You have external redirects listed after the internal rewrites.
List all external redirects in order of most specific to least specific first. After that list all the internal rewrites, again in order of most to least specific.
Some rules never get to be processed because a prior rule incorrectly grabs all requests. Fix the types and the order and we'll take another look.
You have mixed RewriteRule and Redirect/RedirectMatch directives in the same file.
Use RewriteRule for all of the rules.
You can't have both? Some files are being rewritten as a part of the cms, and some are being redirected because the links come from other sites and the pages don't exist anymore.
Always include the target domain name in the rule when you have an external redirect.
You have external redirects listed after the internal rewrites.
Which external redirects?
List all external redirects in order of most specific to least specific first. After that list all the internal rewrites, again in order of most to least specific.
A little more help on this, not sure I get this. Newbie:)
Some rules never get to be processed because a prior rule incorrectly grabs all requests. Fix the types and the order and we'll take another look.
Like where, could I have an example of this?
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteRule ^foo\.html$ http://www.example.com/bar.html [R=301,L]
I am not familiar at all with this stuff, I appreciate any help.
Perhaps the best help would be the admonishment that none of this is simple, and the potential exists for great damage to the correct operation and search rankings of your site. Success will require intense research, and you cannot depend on 'some guy on some forum' who knows nothing about your site's architecture or operation for this kind of thing, regardless of your schedule pressure or that forum guy's perceived expertise. It's likely a choice between getting it done correctly but slowly, or getting it done incorrectly and fast.