![]() |
![]() |
![]() |
||||
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
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
|
htaccess rewrite remove file extension?
anyone have an example of how to write url file extension
specific rewrite... http://www.site.com/members.html to http://www.site.com/main and then remove all extension for all files ending in *.html http://www.site.com/*.html to http://www.site.com/* also this needs to work with and without www my current htaccess Code:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^(ssss\.com)$ [NC] RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L] RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{HTTP_HOST} !^(www\.)?ssss\.com$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.ssss\.com$ [NC] RewriteRule ^(.*)$ http://www.ssss.com/view/%2.html [R=301,L] RewriteCond %{REQUEST_URI} !^files/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) index.php [L] </IfModule> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 | ||
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,290
|
Quote:
but here is the basis Quote:
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
|
/members.html use /main is exactly what I wanted. not sure which to use for the next part where I want all urls with .html to have the alias of there filename ... whatever.html would be /whatever
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,290
|
that will work then, i used to use something like that for arylia, since tgps didnt like .php files being submitted, i aliased .html to .php
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
58008 53773
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,290
|
Quote:
Code:
# enables domain.com/search/search-term.html Options +FollowSymLinks RewriteEngine On RewriteRule ^search/(.+)\.html$ /index.php?s=$1 [QSA,L] Code:
# make /pics/askj12.jpg work as /askj12.jpg Options +FollowSymLinks RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/data%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}/data%{REQUEST_URI} -d RewriteRule !^pics(/.*)?$ /pics%{REQUEST_URI} [QSA,L] Code:
# from: http://www.example.com/profile.php?user=username # to: http://username.example.com Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC] RewriteRule .* - [L] RewriteCond %{HTTP_HOST} ^([^\.]+)\.example\.com$ [NC] RewriteRule ^$ /profile.php?user=%1 [QSA,L] Code:
# rewrite rules to generate on the fly # /sub/evil.domain.com/pics --> http://evil.domain.com/pics # /sub/content.domain2.com/clicks --> http://content.domain2.com/clicks # /sub/ab.domain3.com/moo --> http://ab.domain3.com/moo Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} !^(www\.)?[^\.]+\.[^\.]+$ [NC] RewriteCond %{HTTP_HOST} ^(.*\.)?([^\.]+\.[^\.]+\.[^\.]+)$ [NC] RewriteCond %{DOCUMENT_ROOT}/sub/%2%{REQUEST_URI}/ -d RewriteRule [^/]$ http://%2%{REQUEST_URI}/ [R=301,L] RewriteCond %{HTTP_HOST} ^(.*\.)([^\.]+\.[^\.]+\.[^\.]+)$ [NC] RewriteRule ^(.*)$ http://%2/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^(www\.)?[^\.]+\.[^\.]+$ [NC] RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+\.[^\.]+)$ [NC] RewriteCond %1:::%{REQUEST_URI} !^(.+):::/sub/\1(/.*)?$ [NC] RewriteCond %{DOCUMENT_ROOT}/sub/%1/ -d RewriteRule ^(.*)$ /sub/%1/$1 [QSA,L] ![]()
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |