.htaccess problem

Status
Not open for further replies.

Mike

New member
Jun 27, 2006
6,777
116
0
51
On the firing line
Trying to get URL's like this:

Code:
http://www.SomeDomain.tld/index.php?sub=123&sub2=3234&sub3=something+else

To look like this:

Code:
http://www.SomeDomain.tld/123/3234/something+else

Here's my .htaccess file:

Code:
Options +FollowSymlinks
RewriteEngine on

RewriteCond %{http_host} ^SomeDomain\.co\.uk [nc]
RewriteRule ^(.*)$ http://www.SomeDomain.co.uk/$1 [r=301,nc]

RewriteRule ^/([^/]+)/([^/]+)/([^/]+)/?$ /index.php?cam=$1&dir=$2&pg=$3 [L]

ErrorDocument 400 /go.php?link=400_error
ErrorDocument 401 /go.php?link=401_error
ErrorDocument 403 /go.php?link=403_error
ErrorDocument 404 /index.php
ErrorDocument 500 /go.php?link=500_error

Using that, my URL's don't look any different. They still FUGLY.
Can someone please tell me where I fucked up. :error:
 


I'm no .htaccess guru, but do you need mod_rewrite enabled? This is what all of mine have, using your code, etc.



<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on

RewriteCond %{http_host} ^SomeDomain\.co\.uk [nc]
RewriteRule ^(.*)$ http://www.SomeDomain.co.uk/$1 [r=301,nc]

RewriteRule ^/([^/]+)/([^/]+)/([^/]+)/?$ /index.php?cam=$1&dir=$2&pg=$3 [L]

ErrorDocument 400 /go.php?link=400_error
ErrorDocument 401 /go.php?link=401_error
ErrorDocument 403 /go.php?link=403_error
ErrorDocument 404 /index.php
ErrorDocument 500 /go.php?link=500_error
</IfModule>
 
Code:
RewriteEngine On
RewriteRule ^/?([0-9]+)/([0-9]+)/([^/]+)/? /index.php?cam=$1&dir=$2&pg=$3 [QSA,L]

Question marks, wha?! Study study study!
 
You need to modiffy you web application too in order to get SFURL, the rewritting will work in the reverse way.
 
This is my standard SEO type .htaccess file. Basically whenever a file is requested that cannot be found it sends the url to /serve.php page which has the code to parse out the url.

RewriteEngine On
RewriteRule ^rss\.xml$ rss.php [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /serve.php [L]
RewriteRule ^$ /serve.php

Also, don't expect this
http://www.SomeDomain.tld/123/3234/something+else

Expect this
http://www.SomeDomain.tld/123/3234/something_else
or this
http://www.SomeDomain.tld/123/3234/something-else

pluses (+) are really bad to use in urls as in querystrings + is also space and Im not sure what implications that has in the serps
 
Status
Not open for further replies.