Hi, My .htaccess has the following: RewriteRule ^H_(.*)\.html$ test.php?a=$1 [L] I want to redirect domain.com/test.php?a=done to: domain.com/H_done.html and still show the data of test.php?a=done but the browser now shows the static URL instead of the regular one (which was typed) Can I do this? Thanks
So you want to force a redirect from: domain.com/test.php?a=done to: domain.com/H_done.html And still have: domain.com/H_done.html Load: domain.com/test.php?a=done ? If so, try this htaccess file.
Hi, That page above gave me this code: RewriteRule ^H_done\.html$ /test.php?a=done [L] I think this is what I already have. The problem with this is that if I type the ugly URL in browser, it does not redirect to pretty URL. Instead it loads the page. You understood my question right. I want it to redirect to pretty URL and still show the same data which the ugly URL loads. Can you give me the htaccess code? Thanks
It should have given you: Options -Multiviews RewriteEngine On RewriteBase / RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule .* - [L] # Redirect old pages RewriteCond %{QUERY_STRING} ^a=([a-z]+)$ RewriteRule ^test\.php$ /H_%1.html? [R=301,L] # Specify search friendly URLs RewriteRule ^H_([a-z]+)\.html$ /test.php?a=$1 [L] # Generated for free at SearchFriendlyURLs.com Code (markup): This part is what redirects from the old addresses to the new: # Redirect old pages RewriteCond %{QUERY_STRING} ^a=([a-z]+)$ RewriteRule ^test\.php$ /H_%1.html? [R=301,L] Code (markup):
I m new here but I one of above syntaxes will redirect they are only simple rewrite rules nothing more than that
Helo, the topic is 'how to redirect this' that's why I will right it here. I have a small problem with making redirect from really strange page: examplesite.com/.html to examplesite.com/ - usual redirect 301 doesn't work. Are pages like that should be redirected in a different way?