Jump to content


Photo

Trimming the '/'?


  • Please log in to reply
2 replies to this topic

#1 sphinx

sphinx

    Advanced Member

  • Members
  • PipPipPip
  • 201 posts

Posted 11 July 2013 - 11:27 AM

Hello.

 

I want to use .htaccess to redirect to eBay items

 

When I use test.co.uk/12345 as an example

 

It is outputting:

 

test.co.uk/test=/12345/go

 

I need it to output:

 

test.co.uk/test=12345/go

 

Thank you

RewriteEngine on
RewriteCond %{HTTP_HOST} =test.co.uk [OR]
RewriteCond %{HTTP_HOST} =www.test.co.uk
RewriteCond %{REQUEST_URI} !^/?$ [NC]
RewriteRule ^ http://www.ebay.co.uk/test=%{REQUEST_URI}/go [R=301,L]

Edited by sphinx, 11 July 2013 - 11:29 AM.


#2 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,143 posts
  • LocationWA

Posted 11 July 2013 - 01:05 PM

Change the one RewriteCond to
RewriteCond %{REQUEST_URI} ^/(.+)
and then use %1 in place of the %{REQUEST_URI} in the RewriteRule.

#3 sphinx

sphinx

    Advanced Member

  • Members
  • PipPipPip
  • 201 posts

Posted 11 July 2013 - 01:23 PM

Thank you!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com