Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1096 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

.htaccess been stuck all day please help

Thread title: .htaccess been stuck all day please help
Closed Thread    
    Thread tools Search this thread Display Modes  
10-22-2006, 07:53 PM
#1
L146705 is offline L146705
Status: Junior Member
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 52
iTrader: 1 / 100%
 

L146705 is on a distinguished road

  Old  .htaccess been stuck all day please help

hi,
I have been trying to do my .htaccess all day the best I can get is this:
to
Code:
www.ebooklobby.com/details/51/Life%2520in%2520the%2520Red%2520Brigade/?id=51&title=Life%2520in%2520the%2520Red%2520Brigade
I want to get rid of the ?id=51&title=Life%2520in%2520the%2520Red%2520Briga de on the end. On the link to the page I pass the id and title parameters is there a way to remove them from the end of the url. Also I want to get rid of the %2520 characters.

The url I want is

Code:
http://www.ebooklobby.com/ebook-title/
Here is the code of the .htaccess file

Code:
RewriteEngine on 
# 
# Internally rewrite search engine friendly static URL to dynamic filepath and query 
RewriteRule /([^/]+)/([^/]+)/?$ /details.php?id=$1&title=$2 [L] 
# 
# Externally redirect client requests for old dynamic URLs to equivalent new static URLs 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /details\.php\?id=([^&]+)&title=([^&]+)\ HTTP/ 
RewriteRule ^details\.php$  http://www.ebooklobby.com/details/%1/%2/ [R=301,L]

10-23-2006, 11:17 AM
#2
Chaos King is offline Chaos King
Status: Member
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 119
iTrader: 4 / 100%
 

Chaos King is on a distinguished road

Send a message via AIM to Chaos King Send a message via MSN to Chaos King

  Old

Try this:

Code:
RewriteEngine On

RewriteRule ^details/([0-9]+)/(.*)/$ details.php?id=$1&title=$2
This will produce:

details/2352/title/

10-23-2006, 08:14 PM
#3
L146705 is offline L146705
Status: Junior Member
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 52
iTrader: 1 / 100%
 

L146705 is on a distinguished road

  Old

thanks I got this one to work
RewriteEngine On
RewriteRule ^([^.]+)/([^.]+)/([^.]+)$ details.php?id=$1&title=$3&catname=$2 [L]

it has loads of %20 in the url, does anyone know how to get rid of them

10-23-2006, 09:08 PM
#4
Andrew R is offline Andrew R
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
 
Posts: 5,200
iTrader: 17 / 95%
 

Andrew R is on a distinguished road

  Old

If you are using $_GET in your PHP code, then you have to use str_replace() or something similar to change any spaces, (" "), or codes such as ("%20"), into hyphens or underscores.

10-27-2006, 07:52 PM
#5
CreativeLogic is offline CreativeLogic
CreativeLogic's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 1,078
iTrader: 6 / 100%
 

CreativeLogic is on a distinguished road

Send a message via MSN to CreativeLogic

  Old

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed