Garsallah mohamed Garsallah mohamed - 1 year ago 127
AngularJS Question

.htaccess redirection for SEO configuration

I have an angularJs based portfolio, Google crawler offer a URI tool for similar platforms. replaces the

which you can use server redirection to changed the directory to serve static files.

I don't use
so the
will be inserted at the end. What I like to do is to make this pattern:

Redirects to

This is the .htaccess file that I used:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=$
RewriteRule ^$ /snapshot/
RewriteRule ^ - [L]
RewriteRule ^ /index.html

The problem is that It only works for the base URL (index.html).
Is there a thing that I am missing?
Thank you.

Answer Source

You have to use the escaped fragment like this:

Then redirect it in your .htaccess:

RewriteCond %{QUERY_STRING} _escaped_fragment_=/([^&]*)
RewriteRule ^$ /snapshot/%1 [R,L]

This should redirect you to

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download