Reply
.htaccess help for URL rewriting
Old 07-08-2008, 06:22 AM .htaccess help for URL rewriting
Novice Talker

Posts: 5
This is really annoying, I'm sure it's something stupid I've done. If anyone can spot anything I've missed, or just plain overlooked then it would be appreciated. Thanks;

I've just done this site and thought I'd try using the forcetype method to generate more SEF URL's. I wish I hadn't now.

http://durban.directrouter.com/~espresso/

I want it to work when I go to http://durban.directrouter.com/~espressso/ethics/

It should, but doesn't

My htaccess file;

Code:
<files index>
RewriteEngine on

RewriteBase /


# remove .php and THE_REQUEST to prevent loops

RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP

RewriteRule (.*)\.php$ $1 [R=301]



# remove trailling slash

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} /$

RewriteRule (.*)/ $1 [R=301]



# add .php to access file, but don't redirect

RewriteCond %{REQUEST_FILENAME}.php -f

RewriteCond %{REQUEST_URI} !/$

RewriteRule (.*) $1\.php

</files>

Ideally, I would like the url to be displayed as ;

http://durban.directrouter.com/~espresso/ (no index.php displayed)

I can't get this to work though. Does anyone know if there is a way to get the .htaccess file to redirect to here without adding the index.php to the URL?

Thanks in advance
markosaurus is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 07-13-2008, 11:32 PM Re: .htaccess help for URL rewriting
Average Talker

Posts: 16
Hi,
Insert this into your .htaccess file and place it under your 'durban' directory.
Code:
RewriteEngine on
RewriteRule ^(~espresso)/$ index.php [L]
This will redirect http://durban.directrouter.com/~espresso/ to http://durban.directrouter.com/index.php
__________________
www.netraits.com | www.mrlogin.com

netraits is offline
Reply With Quote
View Public Profile Visit netraits's homepage!
 
Reply     « Reply to .htaccess help for URL rewriting
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11296 seconds with 13 queries