Tag Info

New answers tagged

0

Try: RewriteEngine on RewriteRule ^(gallery)\/(.+)$ http://website.com/$2 [R=301]


1

You need to use the QSA flag on your rewrite rule. It preserves any query string from the original URL and appends it to the new URL. Your rewrite rule would be: RewriteRule ^(|/)$ index.php?url=$1 [QSA] RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?url=$1 [QSA]


1

Try <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /gallery/$1 [L] </IfModule>


1

It is not exactly the answer to your question but you should think twice about removing trailing slashes for directories. The doc about DirectorySlash warns from potential problems (a mess with relative urls and others). And you can save some headaches by only redirecting with a 301 /dir/index.html to /dir/ (nearly your point 3), and using DirectoryIndex ...


1

products1.php simply needs to output the canonical link in the head section of the page. Presumably it knows the information needed to build your friendly URL: category subcategory product name product id Then the canonical tag appears in both the page for the friendly URL and the page for the parameterized URL. That is fine. Google says that a ...


1

The %{THE_REQUEST} contains the full HTTP request header sent by the browser, not simply the URL. If you examine this value, you will see that for the second (short) URL, THE_REQUEST does in fact contain 3 forward slashes after the word "article" (although not necessarily part of the URL itself) and so matches the pattern. The request line is probably ...


0

%{QUERY_STRING} referrs to everything after the ? in the URL. Your URL doesn't have a question mark, so it isn't matching it. You just want to make sure the that the URL contains forum-viewtopic or forum-viewforum to return 410 gone status. This single rule should do it: RewriteRule forum-viewtopic|forum-viewforum - [G] Another option that would be ...


1

Aren't your last two entries cancelling each other out? # Redirect /foo to /foo/index.html then the other way # Redirect /foo/index.html to /foo If it just for those individual files? Then I'd try: # 301 Redirect /foo/index.html to /foo RewriteCond %{QUERY_STRING} ^$ RewriteRule ^foo/index\.html$ /foo? [R=301,NE,NC,L] # 301 Redirect /foo/ to /foo ...


1

Problem was a WordPress one. It was stripping out the @ when re-writing the non www address to the www address. Problem resolved by adding my old redirect code (which I thought I could dispense with) to top of the .htaccess file: RewriteCond %{HTTP_HOST} ^example\.com$ RewriteRule (.*) http://www.example.com/$1 [R=301,L]


1

You might be able to resolve this by using the NE (noescape) flag on the RewriteRule directive? However, this is admittedly a little puzzling, as even special characters shouldn't be removed entirely, just converted to their hexcode equivalent. The NE flag allows special characters to be passed through untouched. However, your current rules can be greatly ...


0

Step 1: Set up your add-on domain with separate FTP Here is GoDaddy documentation for an add-on domain. Their instructions says that creating a secondary domain with different content will create a separate ftp user and password where you can upload your content. That is what you want to do. If you do it that way then snapstarr.com/fuselog/ (and ...



Top 50 recent answers are included