Mobile app version of vmapp.org
Login or Join
Murray155

: Redirect and removing question mark on URL using htaccess When I access my site using www.example.com/blog it redirects to example.com/?/blog. How can I remove the question mark, so that the redirection

@Murray155

Posted in: #Htaccess #UrlRewriting

When I access my site using example.com/blog it redirects to example.com/?/blog.

How can I remove the question mark, so that the redirection just goes to example.com/blog?

My current .htaccess file:

RewriteEngine On
RewriteBase /

# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index.php/*(.*) / [R=301,NE,L]

# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/ [L]

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray155

1 Comments

Sorted by latest first Latest Oldest Best

 

@Candy875

Notice that you are rewriting URL to: /index.php?/. After this rewrite is done, the server removes index.php from URI. Thereby generating that URL. Just remove the ? from above rewrite.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/ [L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme