Tag Info

New answers tagged

1

RewriteEngine on RewriteRule ^/site/(.*) /~username/site/$1 [PT] That code should be going into .htaccess, not httpd.conf. Try that, and it should fix your issue.


0

Google Webmasters also explains why the URLs are still indexed with their YouTube video. It takes a good while for the actual removal process of the old links to happen. Also, you have to remember, Google is indexing, re-indexing, and deleting records from their Search Engine all of the time at a massive rate already, but there is trillions upon trillions ...


1

I've had a quick test and this should do the trick: RewriteEngine on RewriteRule ^([0-9]+)/([0-9]+)$ /date/$1/$2 [R=301,L] You may also need to exclude this from the redirect to the index.php page by adding RewriteCond %{REQUEST_URI} !^/(date) [NC] so it should look like this # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On ...


0

Your "Method 2" looks appropriate to me to match http://www.testdomain.com/john/2/doe. Only, you may want to try to add the RewriteBase / too, something like this: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/([^/]+)/(.*)$ test.php?name=$1&id=$2&nick=$3 [L,QSA] Instead ...


0

I had a similar rule, try this one: RewriteEngine On RewriteBase / RewriteRule ^test/([A-Za-z0-9-]+)/([0-9]+)/([A-Za-z0-9-]+)/?$ test.php?name=$1&id=$2&nick=$3 Your links should be: test.php?name=john&id=2&nick=doe


3

You mentioned that two options are valid for you, so I'm using the second one, http://www.testdomain.com/john/2/doe, and assuming a clean .htaccess RewriteEngine On # RewriteCond %{REQUEST_FILENAME} !-f # RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{QUERY_STRING} ^name=([\w]+)\&id=([\d]{1,3})\&nick=([\w]+)$ RewriteRule .* /%1/%2/%3? [R=301,L] ...


1

I completely agree to all the answers put above. Just adding that one of the reasons why extensions are hidden in URL is to security. Putting it simply, if you don't expose the extension in the URL, it is little hard to figure out the technology on which the application has been built. So lets say a page in made in PHP and the extension is not hidden, then a ...


0

You define a rule backwards, so this is not working. The syntax is as following: This would work, but will most likely break your magento (as all urls with a dash "-" in it will be rewritten): RewriteRule ^/(.*)-(.*)$ /parent-category/sub-category/$2/$1 [L,NC] So I would suggest putting it under some kind of static keyword, like "shop", so when you ...


0

Try this: RewriteEngine on RewriteRule ^(.*) $1 [L] RewriteRule ^products/$ products.php?id=31 [L] This code working fine for me.


0

I found the perfect solution: Use RedirectMatch I will have a virtual host configured for each mini-site that will look like this: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName city.site.com ServerAlias www.site.com city.site.com RedirectMatch ^/(.+) http://www.site.com/$1 RedirectMatch / ...


-3

Use linux hosting. May be your hosting server is on windows. Windows gives problems sometimes with htaccess.


0

You should just redirect everything to your script then process in there like so: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule (.+) index.php?url=$1 [QSA] So then you can explode the $_GET['url'] by / to get the individual parameters.



Top 50 recent answers are included