Menu
  • HOME
  • TAGS

How to write my rewriterule so I can have friendly url

Tag: .htaccess,seo,rewrite,opencart,friendly-url

My SEO expert asked me to do HTTP 301 redirect to a friendly URL in an Opencart installation. This Opencart installation use SEO url so I have this url (native url in opencart) : http://www.qcbikeshop.com/index.php?route=information/information&information_id=9

and the SEO url is : http://www.qcbikeshop.com/Livraison-Gratuite

However, my SEO expert want me to do a HTTP 301 redirect so that when someone access the native URL (the first one), he his redirected to the SEO url.

When I try to do it in .htaccess, Apache say it is in an endless loop and I understand it. But I didn't found how to achieve what I'm trying to do.

Here's my current rewrite stuff in my .htaccess file :

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

RewriteCond %{HTTP_HOST} ^qcbikeshop\.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www\.qcbikeshop\.ca$
RewriteRule ^/?$ "http\:\/\/qcbikeshop\.com" [R=301,L]

RewriteCond %{HTTP_HOST} ^qcbike\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.qcbike\.com$
RewriteRule ^/?$ "http\:\/\/qcbikeshop\.com" [R=301,L]

RewriteCond %{HTTP_HOST} ^qcbike\.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www\.qcbike\.ca$
RewriteRule ^/?$ "http\:\/\/qcbikeshop\.com" [R=301,L]

RewriteCond %{HTTP_HOST} ^spherikbike\.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www\.spherikbike\.ca$
RewriteRule ^/?$ "http\:\/\/www\.spherikbike\.com\/" [R=301,L]

Redirect 301 /mtb-comp-fr.html http://www.qcbikeshop.com/accessoires/pompes-velo/mtb-comp-fr.html

CPanel Rewrite tool generate this for my example above :

RewriteCond %{HTTP_HOST} ^qcbikeshop\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.qcbikeshop\.com$
RewriteRule ^index\.php$ "http\:\/\/www\.qcbikeshop\.com\/Livraison\-Gratuite" [R=301,L]

It seems very wrong to me. Thanks for your help!

Best How To :

You can place this rule above the others and see how it works for you.

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?information/information&information=9
RewriteRule .* /Livraison-Gratuite? [R=301,L]

Htaccess regex: exclude REQUEST_URI

regex,apache,.htaccess,mod-rewrite,redirect

Try this rule instead: RewriteCond %{HTTP_HOST} ^sub\.example\.com$ [NC] RewriteCond %{THE_REQUEST} !\s/+(aaa|bbb|ccc)/ [NC] RewriteRule . http://www.example.com%{REQUEST_URI} [R=301,L,NE] Test it after clearing your browser cache. Using THE_REQUEST instead of REQUEST_URI to make sure we use unchanged URI values as received by Apache....

Dissallow php execution for CSS folder with htaccess from parentfolder

php,apache,.htaccess

A better way to do it would be to just switch PHP off in that directory if you don't want it running... though granted this would mean that additional .htaccess file. However it would also prevent PHP from running in anything like .phtml files as well - I'd say it's...

.htaccess allow image to display directly

php,regex,apache,.htaccess,redirect

Add conditions before your rule to skip image/css/js filesdirectories: RewriteEngine On RewriteRule !\.(?:jpe?g|gif|bmp|png|tiff|css|js)$ index.php [L,NC] ...

Page doesn't load after .htaccess redirect with parameters

php,.htaccess,url-rewriting

The order of your directives is incorrect. Use it as below instead: Options +FollowSymlinks Options -Indexes ErrorDocument 404 /404.php RewriteEngine On RewriteBase / # Add "www." RewriteCond %{HTTP_HOST} ^example.com$ RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] # Rewrite profile/x/x/x to profile.php RewriteRule ^profile/([^/]*)/([^/]*)/([^/]*)/?$ profile.php?url=$1&id=$2&ref=$3 [L] ...

Server side vs client side website

javascript,html,ajax,html5,seo

There is only one real SEO issue at stake here: content accessibility. Some search engines don't execute Javascript as part of crawling and indexing. So if your content cannot be accessed with a URL defined in a sitemap without using Javascript, then such content will not be indexed and ranked....

How to rewrite example.com/catelogue.php?page=3&cat1=fruit&cat2=apple with .htaccess

php,apache,.htaccess,mod-rewrite,url-rewriting

This should work. Try your rules this way. It works for me. Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^catelogue/([^/]+)/([^/]+)$ catelogue.php?page=3&cat1=$1&cat2=$2 [NC,L] RewriteRule ^catelogue/?$ catelogue.php?page=3 [NC,L] RewriteRule ^home/?$ index.php?page=1 [NC,L] ...

Apache Regex How To Get This Value

php,regex,apache,.htaccess

The query string is separate from the request uri. In your case you only want to add a value to it, so you can use the [QSA] (Query String Append) flag to pass the entire query string with the value you captured from the URI Try: RewriteRule ^demo/(.*)$ demo.php?utm_campaign=$1 [L,NC,QSA]...

Make dynamic links (with ?) return error 404 not found

apache,.htaccess,dynamic,hyperlink,http-status-code-404

I assume you're asking for any request containing a query string to return a 404. If that is what you want, use the below: RewriteEngine On RewriteCond %{QUERY_STRING} .+ RewriteRule .* - [R=404,L] This will use the regex .+ to check if there are one or more characters in the...

OctoberCMS : Have to go to index.php

php,.htaccess,apache2,octobercms,ovh

nanohard on OctoberCMS forum, as answered my question. Here is the answer; Make sure mod_rewrite is on using a2enmod rewrite and then service apache2 restart. Source : http://octobercms.com/forum/post/only-index-works?page=1#post-7140...

mod_rewrite - force redirecting to rewritten URL

apache,.htaccess,mod-rewrite,redirect

You need a new rule for that redirect: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} /(?:index\.php)?\?search=([^\s&]+) [NC] RewriteRule ^ search/%1? [R=302,L,NE] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^search/(.*)$ /?search=$1 [L,QSA] ...

Rewrite url not working in htaccess

php,apache,.htaccess,mod-rewrite,url-rewriting

QUERY_STRING is only used to match query string without URI. You need to use: Options -MultiViews RewriteEngine On RewriteBase /mywbsite/ RewriteCond %{THE_REQUEST} /search_data\.php\?keywords=([^&]+)&f=([^\s&]+) [NC] RewriteRule ^ search/%1/%2? [R=301,L] RewriteRule ^search/([^/]+)/([^/]+)/?$ search_data.php?keywords=$1&f=$2 [QSA,L,NC] ...

.htaccess | Too many redirects

apache,.htaccess,mod-rewrite,redirect

I'm assuming that you are trying to do two things here: Force HTTPS and www. Redirect to test.php if a certain IP is making the request The issue you were facing was due to the fact that even though the IP address was being matched, it was still being checked...

after using mod_rewrite link are not found

php,.htaccess,mod-rewrite

So you want the assets to be requested correctly? I guess you're using incorrect relative paths for linking those in your page's code (something like "images/image.jpg"..). If that's the folder structure you have, try to go one level up and use this path: <img src="../admin/images/image.jpg" ... or, in the case...

Https rewrite needs fix when visitors enter www. at the beginning [closed]

php,.htaccess

This works for me: RewriteCond %{HTTP_HOST} !^www\.example\.com$ RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301] RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}/$1 [L] The first rule redirects all requests to www.example.com if the host does not match (missing www, but also "fetch all subdomains"). The second rule redirects all other requests using HTTP to HTTPS....

Rewrite non-dynamic pages using htaccess

apache,.htaccess,mod-rewrite

Try the following rules in your /htaccess file : RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/([^.-]+)\.php [NC] RewriteRule ^ %1/ [NC,R,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/([^-]+)-([^.]+)\.php [NC] RewriteRule ^ %1/%2/ [NC,R,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/?$ $1.php [QSA,NC,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/([^/]+)/?$ $1-$2.php [QSA,NC,L] ...

mod-rewrite to remove a folder

apache,.htaccess,mod-rewrite

Your rule is backwards - it works the other way around. You can try with the following: RewriteRule ^folder1/folder2/(.*)$ /demo/folder1/$1 [R,L] Or perhaps you'd like to make folder1 dynamic: RewriteRule ^([^/]+)/folder2/(.*)$ /demo/$1/$2 [R,L] If one of these works for you, and you would like to make the redirect permanent, you...

URL Rewriting in php CodeIgniter using .htaccess

php,apache,.htaccess,codeigniter,mod-rewrite

I think the problem are the missing placeholders. Without the placeholders your stated URL http://www.mysite.pk/jobs/search/faisalabad/all-cats won't match. The correct route should look like this: $route["jobs/pakistan/(:any)"]="vacancies/search"; $route["search/pakistan/(:any)"]="vacancies/search"; This way both jobs/pakistan and search/pakistan are working. Edit This RewriteRule will have the same effect when put in the .htaccess file. RewriteRule ^jobs/search/(.*)?$...

Htaccess rewrite URL with virtual directory and 2 variables

regex,apache,.htaccess,url,rewriting

ok , I assume you want to change the URI from http://www.example.com/result.php?team=arsenal&player=ospina to http://www.example/subdirectory/arsenal/ospina.html so this is the .htaccess that will do that for you RewriteEngine on RewriteCond %{QUERY_STRING} ^team=(.*)\&player=(.*)$ RewriteRule ^(.*)$ http://www.example.com/subdirectory/%1/%2.html [R=301] you can test it with htaccess tester here http://htaccess.madewithlove.be/ and some useful links for documentation and...

Mod Rewrite Maintenance page that uses multiple URLs

windows,.htaccess,redirect,isapi-rewrite

You need to check HTTP_HOST in your condition to check for the domain and then redirect based on that. RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?foo\.bar [NC] RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 RewriteCond %{REQUEST_URI} !/maintWWW.html$ [NC] RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] RewriteRule .* /maintWWW.html [R=302,L] RewriteCond %{HTTP_HOST} ^(www\.)?bar\.foo [NC] RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 RewriteCond %{REQUEST_URI} !/maintWWW2.html$...

Do 301 redirects work on urls that contain query strings?

.htaccess,http-status-code-301

Yes there's a trick. You can't use Redirect directive with query strings. You could just do something like this with mod-rewrite. Just change the corresponding query string value for every individual link you have. RewriteEngine On RewriteCond %{QUERY_STRING} (.+)=39 RewriteRule ^blogsearch/?$ /blogsearch/Coffee? [L,NC,R=301] RewriteCond %{QUERY_STRING} (.+)=26 RewriteRule ^blogsearch/?$ /blogsearch/Food? [L,NC,R=301]...

AH01630: client denied by server configuration Apache

linux,apache,.htaccess,prestashop,prestashop-1.6

There are a couple of things I see just looking at the configuration. You have your vhost config named etc/apache2/sites-enabled/prestashop.config But that is not the file type that is being included in the apache.conf file. # Include the virtual host configurations: IncludeOptional sites-enabled/*.conf Your apache setup looks for .conf files...

Redirect pages in Sub folder using .htaccess

.htaccess,url-rewriting

Try this in your Public_html/.htaccess : RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/?$ /some-work/$1 [L,NC] ...

Redirection loop (URL rewriting)

regex,apache,.htaccess,mod-rewrite,rewriting

I suggest not using .php in pretty URL, make it extension-less. Try these rules in v2/.htaccess: RewriteEngine On RewriteBase /v2/ RewriteCond %{THE_REQUEST} /message\.php\?ID2=([^&\s]+) [NC] RewriteRule ^ message-%1? [NE,R=302,L] RewriteRule ^message-(.+)/?$ message.php?ID2=$1 [L,QSA,NC] ...

htaccess query string redirect not working correctly

.htaccess

You cannot check the query string in a RewriteRule, which can only see the REQUEST_URI. You need to use the following instead: RewriteCond %{QUERY_STRING} ^from=all-files$ [NC] RewriteRule ^files/(.+)$ pages/file.php?slug=$1 [QSA,L] When you request http://example.com/files/some-file?from=all-files, the request will be internally rewritten to pages/file.php?slug=some-file&from=all-files. The Query String Append flag (QSA) will append...

Allow space and other special characters in htaccess url rewrite

php,regex,apache,.htaccess,mod-rewrite

You can tweak your regex like this: RewriteRule orderprod_cntr/([^/]+)/([^/]+)/?$ controller/orderprod_cntr.php?id1=$1&id2=$2 [L,QSA] ...

Redirect only non-existing sub-directories to another domain using wildcard

apache,.htaccess,mod-rewrite,redirect

This should work in your .htaccess file on example.com. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/?$ http://example2.com/$1 [R=302,L] Change to R=301 when you confirm it's working. ...

Excluding certain pages from being redirected to https

wordpress,.htaccess,redirect,https,http-redirect

Try using THE_REQUEST instead of REQUEST_URI: <IfModule mod_rewrite.c> RewriteEngine On # Go to https if not on careers RewriteCond %{SERVER_PORT} =80 RewriteCond %{THE_REQUEST} !/careers/[\s?] [NC] RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R,L] # Go to http if you are on careers RewriteCond %{SERVER_PORT} !=80 RewriteCond %{THE_REQUEST} /careers/[\s?] [NC] RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R,L] </IfModule>...

Redirect 301 with wordpress articles from a domain to another

wordpress,.htaccess,redirect

You can use mod_rewrite for this: RewriteEngine On RewriteRule ^(\d+)/(\d+)/(\d+)/([\w\-]+)/?$ http://www.newdomain.com/$1/$2/$3/$4/ [R=302,NC,L] If you are happy with the redirect, and would like to make it permanent, you can change 302 to 301....

Why same .htaccess commands working differently in localhost and server?

php,apache,.htaccess,url-rewriting

The reason this is happening is because you probably have different PHP versions running. I believe this has been considered a PHP bug for some time but don't quote me on that. You might be running an earlier version of PHP (Like maybe 5.2.X) on your localhost and newer on...

Best way to block countries [on hold]

php,apache,.htaccess

You don’t have to fill your .htaccess file with thousands of lines of IPs. Instead, you can install a C library and an Apache module to do the heavy lifting for you. MaxMind provides a popular free database that is often used for IP lookups. Their GeoLite2 is a free...

Unable to connect to your database server using the provided settings in Codeigniter

mysql,.htaccess,codeigniter

$db['default']['password'] = ''; there is an space, remove it use below settings $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = ''; $db['default']['database'] = 'test_bs'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci';...

Remove plus sign from url using .htaccess

php,regex,apache,.htaccess,mod-rewrite

You can add a new rule for +/- conversion: Options -MultiViews RewriteEngine On RewriteBase /indianrealitybytes/ RewriteCond %{THE_REQUEST} /search_advance\.php\?keywords=([^&]+)&f=([^\s&]+) [NC] RewriteRule ^ search/%1/%2? [R=301,L] RewriteRule ^([^+]*)\+(.*)$ $1-$2 [R=302,NE,L] RewriteRule ^search/([^/]+)/([^/]+)/?$ search_advance.php?keywords=$1&f=$2 [QSA,L,NC] ...

htaccess redirect to subdomain based on query string

php,apache,.htaccess,redirect,joomla

You just needed to combine your rules. RewriteCond %{QUERY_STRING} (^|&)option=com_virtuemart(&|$) [NC] RewriteRule (.*) http://parts.domain.com/? [L,NC,R=301] In the second example, you had not provided the regular expression to match....

Apache htaccess redirect file

php,regex,apache,.htaccess,redirect

Try this simplified rule: RewriteEngine On RewriteRule ^aaa/(bbb/ccc/.*)$ http://newwebsite.com/$1 [R=301,L,NC] Make sure to clear your browser cache before testing....

htaccess errors after upgrading Apache from 2.2 to 2.4

apache,.htaccess

The NoCase ([NC]) doesn't even make sense there as you're not matching anything. Just take it out. RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/$1\.php -f RewriteRule ^(.+?)/?$ /$1.php [L] ...

How to write .htaccess file for AJAX page

php,jquery,ajax,.htaccess

I think it's more related to apache than ajax. Anyway - your RewriteRule is ^findcontents/([A-Za-z0-9-]+)/?$ and you post to the url '/findcontents'. Did you try to post to '/findcontents/asdf' ? Another option is to add ^findcontents$ to your rules. If none of these works for you please provide some more...

.htaccess Mod_Rewrite inconsistent

php,apache,.htaccess,mod-rewrite

Try this: Options -MultiViews RewriteEngine On #Working rules: RewriteRule ^privacy$ privacy.php [L] RewriteRule ^terms$ terms.php [L] RewriteRule ^team$ team.php [L] RewriteRule ^candidates$ candidates.php [L] RewriteRule ^clients$ clients.php [L] RewriteRule ^article/([^/]+)/?$ article.php?id=$1 [L,QSA] RewriteRule ^job/([^/]+)/?$ job.php?id=$1 [L,QSA] RewriteRule ^contact/([^/]+)/?$ contact.php?location=$1 [L,QSA] Option MultiViews is used by Apache's content negotiation module that...

How do I retain search engine accessibility when loading external file into html

javascript,jquery,html,seo,cross-platform

Well the problem is that at first, the section you're about to insert data in is blank, which means that sharing this page on Facebook for example will result in just a blank box. So, what you want to achieve is a way to run that javascript before crawling the...

.htaccess for language detection

php,apache,.htaccess,mod-rewrite

Well for this specific example. example.com/xxx/en i need index.php?lang=en&a=xxx You can use a rule like this. RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/en/?$ /index.php?lang=en&a=$1 [L,QSA] ...

Codeigniter URL routing issues in .htaccess

php,apache,.htaccess,codeigniter-2

Okay, as stated before I am not a CodeIgniter guru. What I do know is that the following works for me: Config: $config['base_url'] = "http://www.deltadigital.ca/"; # or use $config['base_url'] = ""; $config['uri_protocol'] = "REQUEST_URI"; $config['index_page'] = ''; Routes: $route['default_controller'] = "tlc/view"; $route['(:any)'] = "tlc/view/$1"; $route['404_override'] = ""; Controller: <?php if...

Filtering QUERY_STRING with back references in RewriteCond

php,regex,apache,.htaccess,backreference

You can use this rule in Apache 2.2: RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// RewriteCond %{HTTP_HOST}#%{QUERY_STRING} !^([^#]+)#.*?\1 RewriteRule ^ - [F] \1 is back-reference for HTTP_HOST Modified the RewriteCond to RewriteCond %{HTTP_HOST}#.*#%{QUERY_STRING} !^([^#]+)#.*?\1 This captures any URL structure. JF ...

URL Rewrite with .htaccess From /user/projects/index.php?project_id=1 to /user/projects/1

apache,.htaccess,mod-rewrite

You can use this rule in your /user/projects/.htaccess. RewriteEngine On RewriteBase /user/projects RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([0-9]+)/?$ index.php?project_id=$1 [NC,L] From the root you can do. RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\ /+user/projects/index\.php\?project_id=([^&\ ]) RewriteRule ^ %1? [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^user/projects/([0-9]+)/?$...

redirect certain pages to its equivalent in another domain, otherwise redirect to its homepage

apache,.htaccess,rewrite,url-redirection

I'm not sure what you mean by But don't know how to exclude other pages But you are already excluding the pages when you create specific rules for them. This should work. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #redirect specific pages RewriteRule ^certain-page$ http://new-domain.com/certain-page [R=301,L] RewriteRule ^another-certain-page$ http://new-domain.com/another-certain-page [R=301,L] #Redirect...

Openshift redirect to https using flask-base example

python,.htaccess,flask,openshift

My understanding for the OpenShift setup is that the .htaccess file can only be used in conjunction with static files and not the dynamic part of your application. To use the standard Apache/mod_wsgi setup you would have to instead use a WSGI middleware that wraps your Flask application to force...

Redirect specific Url variables

php,.htaccess,mod-rewrite,redirect

Try this : RewriteEngine On RewriteCond %{QUERY_STRING} ^s=([^&]+)&type=([^&]+) [NC] RewriteRule ^data.php$ /d.php?s=%1&t=%2 [NC,R,L] This will externally redirect a request for : /data.php?s=foo&type=bar to /d.php?s=foo&t=bar ...

htaccess rewrite rules conflict

php,.htaccess,url,mod-rewrite

Your issue is that the first rule matches, the last one can never get applied... RewriteEngine on RewriteRule ^gallery/([0-9]+)/?$ gallery.php?id=$1 [NC,L] RewriteRule ^([0-9a-zA-Z_-]+)/([0-9]+)$ products.php?cat=$1&id=$2 [NC,L] RewriteRule ^([^/]*)/([0-9a-zA-Z_-]+)/([0-9]+)$ product_categories.php?cat=$2&id=$3 [NC,L] RewriteRule ^(.*)/(.*)/([0-9a-zA-Z_-]+)/([0-9]+)$ product_details.php?cat=$3&id=$4 [NC,L] Rule of thumb: first the specific exceptions, then the more general rules. The NC flag does not...

.htacces rewrite by cookie value

apache,.htaccess,mod-rewrite,cookies,url-rewriting

Try this : RewriteEngine On #Redirecting with the cookie value RewriteCond %{HTTP_COOKIE} ^lang=(en|es)$ [NC] RewriteRule ^(.*)$ http://example.com/%1/$1 [R,L] If the cookie is set to "en" this will redirect every requests to example.com/en/...

Pretty URLs aren't working after upgrade to Mediawiki 1.24.2

.htaccess,ubuntu,mediawiki

Make sure, that you checked the following points: - the mod_rewrite module is enabled - you allow the htaccess to overwrite the settings you want (check, if the AllowOverwride directive is set, e.g. (that would be the easiest value) to all, see http://httpd.apache.org/docs/current/de/mod/core.html#allowoverride # your directory definition AllowOverwride All #...

Force WWW when URL contains path using .htaccess

.htaccess,session,url,redirect

It seems to look ok but one thing you should do is always put your other rules before the wordpress rules as a habit. When using wordpress it should generally be the last set of rules since it does all the routing. Now for the redirect, you should probably use...

Pattern matching in htaccess rewrite condition

apache,.htaccess,mod-rewrite,https

You need to tell the RewriteCond what to match !/go/ against. Change the second line to: RewriteCond %{REQUEST_URI} !/go/ [NC] ...