![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Too lazy to set a custom title
Join Date: Dec 2006
Posts: 23,400
|
One and done.
__________________
i like waffles |
![]() |
![]() ![]() ![]() ![]() ![]() |