Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-07-2010, 03:07 PM   #1
zentz
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Posts: 8,053
.htaccess redirect, wildcard

Is there a wildcard that i can use if i want to redirect all urls containing /somedir/blabla/694 ?

example
Redirect 301 /somedir/blabla/694-some-link http://www.website.com/blabla/some-link
Redirect 301 /somedir2/blabla/694-some-other-link http://www.website.com/blabla/some-other-link
Redirect 301 /somedir3/blabla/694-some-third-link http://www.website.com/blabla/some-third-link

Basicly i want to remove "/somedirX" and "694-" from the urls. Is this possible to do this with 1 line of code or do i need 1 line for each url redirect?

Thank you

Last edited by zentz; 03-07-2010 at 03:09 PM..
zentz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-08-2010, 12:21 AM   #2
Kevsh
Confirmed User
 
Join Date: Dec 2004
Location: TO
Posts: 8,619
You can use regular expressions with redirects, so something like this - although I'm sure the syntax is not exactly correct, hopefully you get the idea:

Redirect 301 /somedir[0-9]*/694-(.*) http://www.website.com/blabla/$2

[0-9]* says to match any number between 0 and 9, zero or more times
(.*) matches any character, zero or more times
$2 will copy the contents matched by (.*) and preserve them

These links may be of some help:
http://www.gnc-web-creations.com/301-redirect.htm
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
Kevsh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-08-2010, 01:13 AM   #3
Iron Fist
Too lazy to set a custom title
 
Join Date: Dec 2006
Posts: 23,400
One and done.
__________________
i like waffles
Iron Fist is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.