Tag Info

New answers tagged

1

Try the following in .htaccess: RewriteEngine On RewriteCond %{QUERY_STRING} ^(.*)DriveType:Flash:(.*)$ RewriteRule ^us/Product-Family/Products/c/Products/layout$ /$0?%1DriveType:Flash SSD:%2 [R=301,L] This only matches the URL specified and externally redirects to the new URL. This could perhaps be made more efficient by restricting the pattern that will ...


2

<FilesMatch "^(.*)\-\-.+\.(js|css)$"> FilesMatch takes a filename and matches against the file system, not the URL. The underlying file is still called "myscript.js", so this pattern should be something like: \.(js|css)$ (Aside... your example request appears to be for common.js - which wouldn't have matched your pattern anyway - shouldn't this be ...


0

This is really something that the hosting ISP should re-point on their end: <VirtualHost *:80> ServerName www.mysubsite.com DocumentRoot /path/to/projects/mysubsite </VirtualHost> You might be able to fix it in .htaccess: RewriteCond %{HTTP_HOST} ^www\.mysubsite\.com [OR] RewriteCond %{HTTP_HOST} ^mysubsite\.com RewriteRule ^(.*) ...


2

The problem is that, when you use mod_rewrite in an .htaccess file or a <Directory> section, every successful RewriteRule — even an internal one — causes the request to be restarted internally, and thus the whole rewrite ruleset to be reprocessed. Thus, what's happening is that, when the user visits /page, your internal RewriteRule matches ...


2

I asked this same question on StackOverflow. To get it to work properly, you have to use environment variables: RewriteRule ^page$ /page.html [L,E=LOOP:1] RewriteCond %{ENV:REDIRECT_LOOP} !1 RewriteRule ^page.html$ /page [R=301,L] This is because mod_rewrite does multiple passes through your rules. During the first pass, it sets the environment ...


1

The URL slug is always a good idea for one simple reason- okay two. 1] We are human. Humans relate to language and language is preferred over numbers which mean nothing to us. 2] Basic SEO. Because Google is made for humans, it's algorithms are centered around language and how humans use it. Google looks to language as clues on how to index a ridiculously ...



Top 50 recent answers are included