Can someone help me please? I'm not good in regex and even worst in english.
I have put this in .htaccess
- Code: Select all
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} \?\ HTTP [NC]
RewriteRule .? http://www.mydomain.com%{REQUEST_URI}? [R=301,L]
Because that was only way to get rid of "?" in url, like this:
http://www.mydomain.com/index.php?
but after I added your code:
richardk wrote:Try
- Code: Select all
# Make sure the query string is empty.
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{REQUEST_URI} ^/(.+/)?index\.php$ [NC]
RewriteRule ^(.+/)?index\.php$ /$1 [NC,R=301,L]
all I get is loop:
- Code: Select all
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.
* Have you disabled or blocked cookies required by this site?
* NOTE: If accepting the site's cookies does not resolve the problem, it is likely a server configuration issue and not your computer.
Can someone tell me where is error, I'm not getting it?
With second code, I still get url like this:
http://www.mydomain.com/?
Thanks