2

To redirect these URLs, you can do something like the following at the top of your .htaccess file, before the WordPress front-controller: RewriteRule ^(some-article\.html)/ /$1 [R=301,L] This checks for /some-article.html followed by a slash (and optionally anything else). And redirects to /some-article.html (the value of the $1 backreference). The $1 ...


2

As @Evgeniy has already covered in his answer, in order to add HTTP response headers to resources external to your site, you need to copy these resources locally - to a server that you control - so you can send the HTTP response header as part of the HTTP response. However, whether you should do this or not is another matter and each instance should be ...


2

Went through your site and it works perfectly, Usually when you change hosts, It takes some time to fully propagate, Perhaps that's what you experienced, Use other devices and probably incognito mode to try it again and it works fine. There's no problem seen!


2

Because your rules conflict... RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^\.]+)$ $1.php [NC] Your first rule matches a request of the form /username and rewrites this to username.php, before your second rule gets a chance to see the request. username.php does not match your second rule. One way to avoid this ...


2

Don't use noindex, it's just not necessary. It seems you have a XSL/XSLT for the sitemap, which doesn't help and is the most likely cause for Google adding the sitemaps in its' index by mistake. EDIT: Unless you specifically restrict indexing of your sitemaps, Google will archive them in its' index. However, if you have followed the rules and guidelines, ...


1

Many JS functions on my site are sending Ajax request to /?something=3213214 but I need to redirect them to /something=3213214 In this case, you should really "fix" these AJAX requests. If that is not possible then you could perhaps implement a workaround as an internal rewrite - but that will depend on how the AJAX request is being routed. Trying to ...


1

So for some reason I still do not fathom, the fix turned out to be altering the target directory's permission from 750 to 755. (The files within the directory did not have to have their permissions altered at all, just the folder containing the redirected site.) That was the answer, discovered by the helpful folks at Nixihost.


1

As already noted, there's nothing seriously wrong with your .htaccess file and your site does now work (a permissions issue?). However, there are a few issues / suggestions regarding your current directives: rewriterule ^news$ "http\:\/\/eepurl\.com\/AjC-j" [R=301,L] #57e44bbcecccd This last directive (an external redirect) is not doing anything. The ...


1

If you want to match specific user-agent strings then you don't need to use a regex (in fact, I would recommend not using a regex if you want an exact match). With mod_rewrite, the = CondPattern operator allows you to specify a lexicographical string comparison, ie. an exact match. For example: RewriteEngine On RewriteCond %{HTTP_USER_AGENT} "=Mozilla/5.0 ...


1

is it OK these js files to be saved in my server Sure. You must only seriously care about updates. Google doesn't recommend to host such files locally - the only cause for it is that the most users hosting such files locally don't do updates in the timely manner.


1

No, you aren't able to manage headers of files you don't host by your own. The single way to manage headers of those files you mentioned (google analytics and so on) is to host them locally. In this case you must manage their updates too. In general you can match files in htaccess with their file types, like this: <IfModule mod_expires.c> # Enable ...


1

any URL which is followed by a question mark (?) I want to be redirected to the 404 page Using mod_rewrite at the top of your .htaccess file you can do something like the following to serve a 404 for any request that contains a query string (the part after the first ?). RewriteEngine On RewriteCond %{QUERY_STRING} . RewriteRule ^ - [R=404] The single dot ...


Only top voted, non community-wiki answers of a minimum length are eligible