Rewrite Folder Problem. Help plz

Discuss practical ways rearrange URLs using mod_rewrite.

Rewrite Folder Problem. Help plz

Postby kenjilee » Sun Jun 22, 2008 1:14 am

I use bluehost.

This is my .htaccess
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^$ /index.php [L]

RewriteCond $1 !^(index\.php|public|wall|install|img|smarty|images|scripts|fonts|uploads|css|js|robots\.txt|sitemap\.xml|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteRule (.*)-(.*)\.html$ wallpapers/show/$2
RewriteRule (.*)-(.*)/$ categories/show/$2
RewriteRule (.*)-(.*)\/(.*)$ categories/show/$2/$3


It's can rewrite *.html , *-*/* ...

But why /members , /contact not rewrite ???

I want create a rules to rewrite:
mydomains.com/contact -> mydomains.com/index.php/contact
mydomains.com/tags/show/key -> mydomains.com/index.php/tags/show/key

Please help !
kenjilee
 
Posts: 1
Joined: Sun Jun 22, 2008 1:11 am

Postby richardk » Sun Jun 22, 2008 2:39 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^$ /index.php [L]

# Files
RewriteCond %{REQUEST_URI} !^/(index\.php|robots\.txt|sitemap\.xml|favicon\.ico)$
# Directories
RewriteCond %{REQUEST_URI} !^/(public|wallpapers|categories|install|img|smarty|images|scripts|fonts|uploads|css|js)(/.*)?$
RewriteRule ^(.+)$ /index.php/$1 [L]

RewriteRule ^.+-(.+)\.html$ /wallpapers/show/$1    [QSA,L]
RewriteRule ^.+-(.+)/$      /categories/show/$1    [QSA,L]
RewriteRule ^.+-(.+)/(.+)$  /categories/show/$1/$2 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 91 guests

cron