Wrong Redirect/Rewrite Rules?
Wrong Redirect/Rewrite Rules?
Wrong Redirect/Rewrite Rules?
The main issue or problem is that it redirects me to example.com/website/ By default Apache (mod_dir) will “fix” the URL with a 301 redirect to append the trailing slash if it is omitted from a filesystem directory. This is necessary for other Apache features to function correctly… without the trailing slash, the DirectoryIndex document is … Read more
You’ve put the directives in the wrong place, the canoncial redirects need to go before the # BEGIN WordPress section (the front-controller), otherwise, they are not going to be processed for anything other than physical files and directories. (The “homepage” maps to a physical directory, so is redirected). For some reason you have also repeated … Read more
Try it like this: RewriteCond %{HTTP_USER_AGENT} (ADmantX|Proximic|Barkrowler|X-Middleton) [NC] RewriteRule ^ – [F] This will block any request where the User-Agent string contains either ADmantX, Proximic, Barkrowler or X-Middleton. The NC flag makes this a case-insensitive match – whether this is strictly required or not in this example I don’t know, but generally this should be … Read more
503 Service Unavailable error was encountered
A quick way might be to simply append a query string to the URL in order to prevent the redirect (eg. ?noredirect) – simply appending a query string should not prevent the old homepageA from displaying. You’ll presumably want to prevent indexing of the ?noredirect URL. This can be achieved by sending an X-Robots-Tag: noindex … Read more
My use: # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ – [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] # BEGIN WordPress # As diretrizes (linhas) entre “BEGIN WordPress” e “END WordPress” são # geradas dinamicamente e só … Read more
.htaccess rewriting old RSS feed URL to WordPress feed URL
sitemap contains weird links and does not contain my pages [closed]
RewriteRule ^subfolder http://www.example.com/ [R=301,L] Strictly speaking this redirects any URLs that start /subfolder, including URLs of the form /subfolderfoo and /subfolderbar which obviously don’t fall “within the subdirectory”. And this is regardless of whether “subfolder” is a physical subdirectory on the filesystem or an entirely virtual (WordPress) URL-path. (If it was a physical subdirectory then … Read more