: Htaccess rewrite doesn't work I'm trying to redirect url's in my /joomla/ folder containing "rsform" to the same url but except for /joomla/ /formulieren/. However my tried .htaccess rewrite doesn't
I'm trying to redirect url's in my /joomla/ folder containing "rsform" to the same url but except for /joomla/ /formulieren/. However my tried .htaccess rewrite doesn't work. I tried:
RewriteEngine on
RewriteCond %{REQUEST_URI} rsform
RewriteRule ^(.+)$ watervriendengeleen.nl/joomla/ [L,R=301]
And other URL related rewrites like Redirect /joomla/index.php?option=com_rsform&formId=12&Itemid=99999 sitename.com/formulieren/index.php?option=com_rsform&formId=12&Itemid=99999 which didn't work either.
Any thoughts?
More posts by @Cofer257
1 Comments
Sorted by latest first Latest Oldest Best
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/(.+)$ watervriendengeleen.nl/formulieren/ [L,R=301]
This redirects all requests for files in your /joomla/ subfolder, containing the string "rsform" anywhere in the query string (as suggested by your example) to the same URL in the /formulieren/ subfolder. The query string is also copied across to the substituted URL.
However, I do wonder whether you should be redirecting here, as it may be more preferable to internally rewrite the request if possible? ie. remove the R=301 flag. (But this may or may not work for you?)
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.