Jump to content

Recommended Posts

Posted

In my visitor stats I just found a strange string added to my url

www.domain.com/name-of-page/?sa=X&ved=0CDwQ9QEwEzigAWoVChMIyOTM7sb-xgIVy-8UCh2tBwDi

Here's the question: how can I get processwire to not keep the url like that?

I am already working with canonical, but also want htaccess rewrite or something to take care of this.

Anyone know how to do this?

thanks!

Posted

Found the solution:

This stops access to processwire admin as well! ANybody know how to fix?

Add this to your htaccess file:

RewriteCond %{query_string} .
RewriteCond %{THE_REQUEST} !^.*\/piwik/index\.php?(.*)
RewriteRule (.*) /$1? [R=301,L]
Posted

The backend needs GET data all over the place.

@LostKobrakai, tnx for that, just wondering what it means that GET data are use all over and how to go about it to still allow that to work through htaccess, any ideas?

Posted

Tried all the following, but none allows access to my pwire named admin dir:

RewriteCond %{REQUEST_URI}  !(pwire) [NC] 
RewriteCond %{THE_REQUEST} !^.*\/pwire/page\?(.*) 
RewriteCond %{REQUEST_URI} !^/pwire/.*$ 
RewriteCond %{REQUEST_URI} !^/(pwire) [NC,OR] 
Posted

With these, it's best to tackle them one by one. For this particular one, place the following directly beneath RewriteEngine On:

RewriteCond %{QUERY_STRING} ^sa=[^&]+&ved=[^&]$ [NC]
RewriteRule ^(.*)$ /$1? [R=302,L]

This will trim out the query string and revert to /name-of-page.

  • Like 2
Posted

With these, it's best to tackle them one by one. For this particular one, place the following directly beneath RewriteEngine On:

RewriteCond %{QUERY_STRING} ^sa=[^&]+&ved=[^&]$ [NC]
RewriteRule ^(.*)$ /$1? [R=302,L]

This will trim out the query string and revert to /name-of-page.

Thanks Mike, that seems to do the trick for this one.

Still wondering though, I managed to get all in one go, but lost access to the admin side of pw, would anyone know how to do this.

Maybe do admin on https? Site itself runs on http.

Anyone any ideas?

thanks!

Posted

You could limit the removal of get parameters to just the frontend by disabling the rule for everything in the admin-backend "folder". Disabling them in the backend is a very bad idea as lots of core and 3rd party modules use them. 

  • Like 2
Posted

You could limit the removal of get parameters to just the frontend by disabling the rule for everything in the admin-backend "folder". Disabling them in the backend is a very bad idea as lots of core and 3rd party modules use them. 

HI LostKobrakai, tnx for that, sounds good!

Now if only I knew how to do that, can you give an example that might work?

The code below blocks all get parameters, what do I need to add or change to exclude admin-backend folder?

thanks!

RewriteCond %{query_string} .
RewriteCond %{THE_REQUEST} !^.*\/piwik/index\.php?(.*)
RewriteRule (.*) /$1? [R=301,L]
Posted

That would need an answer from someone other than me. I know that it works, but I'm a total noob when it comes to the actual syntax of those rules. 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...