Mobile app version of vmapp.org
Login or Join
Cofer257

: 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

@Cofer257

Posted in: #Htaccess #ModRewrite #Redirects #UrlRewriting

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cofer257

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie184

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?)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme