Rewrite any uri with querystring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've built a weblog with _javascript_ frameworks, 
right now everything (!-f !-d) is being enrouted by Apache to /index.php which outputs the proper HTML... and navigation are resolved via pushState from then on.

This is a map of the weblog:

/page
/post-1-id
/post-2-id
...

This is the .htaccess:

Options +FollowSymLinks -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
#RewriteCond %{QUERY_STRING} !^_escaped_fragment_=(.*)$
RewriteRule (.*) index.php [L]
</IfModule>

This is working.

The problem is with search engine crawlers. They can't get the contents well.
I want to enroute them to /crawlers.php with Apache. This should be the map some crawlers:

/?_escaped_fragment_= 
/page/?_escaped_fragment_=
/post-1-id/?_escaped_fragment_=
/post-2-id/?_escaped_fragment_=
...

I tried with this 
    
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^$ crawlers.php%1 [QSA,L]

just after RewriteBase / but that seems to only enroute the /, not the "subdirectories".

Thank you!



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux