Jump to content

mod url rewrite


acctman

Recommended Posts

my urls read out as http://www.domain.com/view/USER.html i'd like to change the to http://www.domain.com/USER

my current .htaccess looks like this.

 

DirectoryIndex index.php
Options -Indexes
Options +FollowSymLinks

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}  !-d
RewriteCond %{REQUEST_FILENAME}  !-f
RewriteCond %{REQUEST_URI} !^ads/
RewriteCond %{REQUEST_URI} !^shop/
RewriteCond %{REQUEST_URI} !^mp3/
RewriteCond %{REQUEST_URI} !^swf/
RewriteCond %{REQUEST_URI} !^js/
RewriteRule ^(.*) index.php [L]
</IfModule>

php_flag register_globals on

Link to comment
https://forums.phpfreaks.com/topic/117056-mod-url-rewrite/
Share on other sites

It would be what ever format your user names can possibly be.  Probably the loosest thing you will want to use is:

 

(OMG I just realized I only put half of it x.x.)

 

 

RewriteCond %{REQUEST_FILENAME}  !-d

RewriteCond %{REQUEST_FILENAME}  !-f

RewriteRule ^/([^/]+)/?$ /view/$1.html

Link to comment
https://forums.phpfreaks.com/topic/117056-mod-url-rewrite/#findComment-603283
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.