redirects to internal location using mod_rewrite without full path

Asked by:
bursainfo / 8 Points
2014-04-05 12:10 pm EST
i'm trying to modify my .htaccess file to do some redirects for SEO purposes.
the problem is that I suspect only redirects to full path, include http:// is allowed in your site (and not relative redirect like the one I need:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^(.*)$ /snapshots/%1.html [NC,L]

What can I do? I dont want to use:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule [NC,L]

because it change the path on the browser.

help needed,

To ask this user for more information, please first login.

To submit an answer, please login.

using the rewritebase as mentioned here:
also doesn't working

RewriteEngine On
RewriteBase /~bursai5
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^(.*)$ /snapshots/%1.html [NC,L]
8 Points
2014-04-05 01:15 pm EST



12,049 Points
2014-04-07 1:37 pm EST
Hello bursainfo,

Thank you for your question. Editing an .htaccess file can be difficult, since there are many different ways to code them.

You should not have to put the full path. For example, this should work:

RewriteEngine On
#RewriteBase /
RewriteCond %{HTTP_HOST} bursaisrael\.info
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^(.*)$ /snapshots/%1.html [P,L]

The RewriteBase is probably not needed. I recommend testing it both ways to see if it is doing what you want.

Regarding the outdated article on testing Drupal with a temp URL: I notified our team's Drupal expert, that the article needs revisted, and it should he updated soon. However, in the meantime, you can install Drupal using Softaculous, then test it successfully on the Temp URL, without any coding changes necessary.

If you have any further questions, feel free to post them below.
Thank you,


To submit a comment on this answer, please first login.

Hello john,
first I want to thank you for the reply.
The problem is still not solved -
I changed the .htaccess as you told me, and if I trying to go to
I'm not getting to the snapshot file as the rule define.

if I change:
RewriteRule ^(.*)$ /snapshots/%1.html [P,L]
RewriteRule ^(.*)$
it's actually redirect to

What else could be the problem?
I leave the rule as you suggested me to do,
you can check yourself to see it's not working by visit:

Thanks again.

8 Points

2014-04-10 6:18 pm EST
Hello Bursainfo,

My systems team member and I spent a bit of time exploring your .htaccess rules. We even took them completely out and there was STILL something affecting the rewrite of the URL. We also took your rewrite rules and applied them to a separate website and it worked fine there. The .htaccess rules were restored to their original state after our testing.

My team mate (Jacob) believes the issue with the .htaccess rules has to do with your code. I noticed that you're running a few scripts in the top of your index file that has something to do with the URL. This, in my opinion is what is undermining your .htaccess rules from properly working. Unfortunately, this is above and beyond our normal support. We can help with typical application of .htaccess rules, but we cannot help with the code used in the index file that affects the mapping of the URL. Our apologies that we cannot provide a direct solution. You may need to consult with a web developer or the author of the jquery that you're using for further clarification.

Kindest regards,
Arnel C.
16,427 Points
2014-04-10 8:19 pm EST
Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.