Tag Info

New answers tagged

0

Using a RedirectMatch directive from mod_alias in your .htaccess file should do the trick: RedirectMatch permanent /[^/]+/([0-9]+)-(.*)-([0-9]+)\.html$ /$2-$1-$3 This pulls out the matching parts of your old URLs and redirect them to the new format.


0

Any change will have any impact. Expect about a 10% change or less if you have good rules.


2

Triying the same and on my search I found that symfony2 frameworks .htaccess file is doing that at least it is stated in the file that it would. I tried to use it in my own setup but didnt work. Maybe that will help you guys somehow. # Determine the RewriteBase automatically and set it as environment variable. # If you are using Apache aliases to do mass ...


1

The simplest method would be: # Redirect to HTTP 404 File/Page Not Found Redirect 404 "/ja/any_posts" Redirect 404 "/ja/all_posts" Redirect 404 "/fr/any_posts" Redirect 404 "/fr/all_posts" Though you could also use: # Redirect to HTTP 404 File/Page Not Found RewriteRule ^ja/any_posts$ - [R=404,L] RewriteRule ^ja/all_posts$ - [R=404,L] RewriteRule ...


0

Something along these lines might do what you want. This will redirect the user to the 'main' version of the page, and add a 404 header in the process, removing the old link: RewriteCond %{REQUEST_URI} ^/(ja|fr)/ RewriteRule ^(ja|fr)/(.*?) /$2 [L, R=404]


2

For Q1, the - doesn't mean that processing or iteration would be stopped, simply that the URL path would be passed through without any filtering or processing. The file will continue to execute rules until it reaches the end of the file or a rule is met that has the [L] last rule flag appended to it. To clarify then, RewriteRule .* - ...


1

I found the solution: RewriteRule ^(admin|user)($|/) - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !/subfolder RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] Those rules will rewrite all the root folders to index.php?q=foldername. It will exclude the "admin" and "user" folders.


1

Ordinarily your code should work OK. Although the NC (NOCASE) flag on a numeric value is unnecessary and should be removed. Also note that if you are checking for an exact match (such as a complete IP address) it is usually easier to simply use the = (equals) operator, for example: RewriteCond %{HTTP_HOST} =123.123.123.123 This now matches against the ...


1

As w3d suggested in the comments, you have an open parenthesis, but not one to close it RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\?sek-muenchenstein\.ch$ [NC] # right here -------------^ RewriteRule ^(.*)$ http://muenchenstein.sek-am.ch/ [R=301,L] Also, in the COND line, you have www\?. I think this might be wrong too, it's now literally looking for ...


1

This is the method I use: RewriteCond %{REQUEST_URI} ^/tag/endovenous-laser/.*$ [NC] RewriteRule .* http://www.mydomain.co.uk/treatments/endovenous-laser-ablation-evla/ [R=301,L] Short of a typo, this should work.


0

Without having to specify a domain in the circumstance that multiple domains point to the website root or that a production .htaccess rules can be applied to: RewriteCond %{HTTP_HOST} ^(.*)\.ANYdomain\.com [NC]


0

I have realized that www.succeedonline.co.za does not yet redirect under the non-www site under the https protocall. It does however work fine under the http protocall. Here is an extract of my complete .htaccess file: RewriteOptions inherit RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ...


0

You could also take the approach of multiple rewrite rules. Replace example.com with your actual domain name. RewriteEngine On RewriteCond %{HTTPS} off # HTTPS is off! # Redirect to the secure canonical URL RewriteRule (.*) https://example.com/$1 [L,R=301] RewriteCond %{HTTP_HOST} !^example\.com$ [NC] # Host name is not correct! # (maybe it has a www?) ...


1

Not sure if this would encompass your goal completely, but this would turn http www mode into https non-www mode: RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] Then to redirect the whmcs to a new url, you can probably use a simple 301: Redirect 301 ...


2

Looks like you didnt "escape" the slashes in your directive. Putting backslashes before any / . or : should make it work. Also adding the ^ and $ on the wildcard helps. Heres what we use: Standard Domain: Perhaps there is a consolidated way, but this snippet should work for a standard domain. Change the target of the first rewrite to https if you need all ...


1

mod_proxy can be configured from .htaccess to serve content from a different server or host as a subfolder. You would use a rewrite rule with the [P] flag (for proxy) in your .htaccess to do so: RewriteRule ^/subdomain/(.*) http://subdomain.example.com/$1 [P] ProxyPassReverse /subdomain/ http://subdomain.example.com/


0

Not without redirects. The only way you can do it without a redirect is to use a reverse proxy (either apache, or nginx would work great).


0

Try plain old Redirect instead. Its behavior is to set up the one to one match you are looking for. The following redirects every page on your current domain to the corresponding page on your new domain. Redirect 301 / http://newdomain.com/



Top 50 recent answers are included