Welcome Guest, Not a member yet? Register   Sign In
Clean URLS using PyroCMS
#1

[eluser]codedoode[/eluser]
I can't seem to figure out how to get mod_rewrite to work, not sure if this is a bug or I'm just overlooking something when I'm setting it up.

Basically what I am trying to achieve is clean urls such as:

Code:
http://domain.com/about

which will not work currently with mod_rewrite turned on via install.

Code:
http://domain.com/index.php/about

is the only way my urls will work correctly.

Anyone with any insight please help!
#2

[eluser]InsiteFX[/eluser]
Maybe this should be asked in the PyroCMS forums!

InsiteFX
#3

[eluser]codedoode[/eluser]
I did post there, however I figured I'd get a better response here.
#4

[eluser]InsiteFX[/eluser]
Code:
#The .htaccess Code

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

#Conversely, if you'd prefer to use "www" in all of your URLs, you can code:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

InsiteFX
#5

[eluser]codedoode[/eluser]
Thanks what if my URL is like this

Code:
http://domain.com/pyrocms

I tried using the following with no luck

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.com\/pyrocms\/$ [NC]
RewriteRule ^(.*)$ http://domain.com\/pyrocms\/$1 [L,R=301]
#6

[eluser]InsiteFX[/eluser]
Then that would be a base_url, Route or a _remap

The .htaccess should only include the domain root.

InsiteFX
#7

[eluser]codedoode[/eluser]
I got it working thanks!




Theme © iAndrew 2016 - Forum software by © MyBB