Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



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

Posts: 5
Trades: 0
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
 
 
Register now for full access!
Old 07-14-2008, 12:32 AM Re: .htaccess help for URL rewriting
Average Talker

Posts: 16
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.23266 seconds with 12 queries