Tag Info

New answers tagged

1

I think the following mod_rewrite directives should do what you require, however, whether they do anything at all may be dependent on your configuration. RewriteEngine on RewriteCond %{QUERY_STRING} rsform RewriteRule ^joomla/(.+)$ http://watervriendengeleen.nl/formulieren/$1 [L,R=301] This redirects all requests for files in your /joomla/ subfolder, ...


2

You can't check for the query string using the RewriteRule pattern (the query string is stripped before pattern matching, as is the hostname, etc). So, the rules you stated above simply won't match and you'll get a 404. However, you can use the RewriteCond directive to check the query string: For example: domain.tld/en/abc.php?foo to ...


1

If all you are doing is moving the files on your file system to another location but want to keep the same URL structure, rather than setting up URL Rewrite rules you can change the physical path of your IIS website configuration. I will make the following assumptions: You are running website "mydomain.edu" from a physical location such as ...


1

I had to ask this question myself. It is surprisingly tricky to do. Olaf Dietsche provided the solution of using an environment variable: RewriteRule ^contact$ contact.php [L,E=CLEAN_CONTACT_URL:1] RewriteCond %{ENV:REDIRECT_CLEAN_CONTACT_URL} !1 RewriteRule ^contact\.php$ /contact [R=301,L] That way the redirect only gets executed when contact.php is ...


0

You are mixing the mod_alias and mod_rewrite modules, which means that the end result is often unexpected. You should only use mod_rewrite in your case, that is, repöace your Redirect 301 /contact.php http://www.example.com/contact with RewriteRule contact.php http://www.example.com/contact [R=301,L] And then, as Dave mentioned, you should use the [L] ...


0

Use the [L] flag on your rewrite rule and place your redirect before it. (I'm going to use a rewrite here as well) RewriteRule ^/contact\.php$ http://www.example.com/contact [R=301,L] RewriteRule ^contact$ /contact.php [L] When the first rule is encountered it matches the /contact.php request and is the last rule processed. The redirect to /contact does ...


1

Yes you would. You are telling Apache to take any reference to contact and rewrite the URI to contact.php then telling Apache to take any contact.php reference and change it to /contact which gets captured again by the first rule. Here is what you are missing. For each rewrite or redirect, Apache makes the change then starts the whole matching process over ...


3

I think the following would work: RewriteRule ^/index\.php/rss/rss1klik$ /index.php?option=com_obrss&task=feed&id=2:rss1klik&format=feed&Itemid=160 [L] But this may look better: RewriteRule ^/rss/rss1klik$ /index.php?option=com_obrss&task=feed&id=2:rss1klik&format=feed&Itemid=160 [L] Then the URL would be ...


1

The use of a rewrite condition along with a rule to map transparently to the subdirectory should work. RewriteCond %{HTTP_HOST} ^abc\.mybiz\.domain\.com$ [NC] RewriteCond %{REQUEST_URI} ^(/|.*\.html)$ [NC] RewriteRule ^/(.*)$ /abc/$1 [L] Now when a request for http://abc.mybiz.domain.com/ or http://abc.mybiz.domain.com/index.html is made it will be pulled ...


1

Since I helped you with the htaccess file yesterday, I need to offer some advice here: Do not use Jaun's rule as a workaround. Leave both sites up, so the HTML based site stays indexed while you work on the WordPress Conversion. Sign Up for Google Webmaster Tools, and add both sites to your sitelist. Finish the WordPress Conversion, and remove the HTML ...


1

I believe this will start you off right: I don't believe the rewrite rule is necessary, when the default page for WordPress is index.php Options +FollowSymLinks RewriteEngine on Redirect 301 ^/home.html http://www.mscaspian.com/fa Update Localizing WordPress List of Localization Plug-Ins I am not affiliated in any way to the list of plug-ins ...



Top 50 recent answers are included