Re: mod_rewrite URL and SEO

This is a discussion on Re: mod_rewrite URL and SEO within the Apache Web Server forums, part of the Web Server and Related Forums category; F'up to: alt.apache.configuration barcin wrote: > I get lost. > > I'd be grateful for help. &...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-03-2006
Justin Koivisto
 
Posts: n/a
Default Re: mod_rewrite URL and SEO

F'up to: alt.apache.configuration

barcin wrote:
> I get lost.
>
> I'd be grateful for help.
>
> I only want two rules for my subdomain:
>
> RewriteRule ^site/([0-9]+),([0-9]+)$ index.php?section=$1&article=$2
> [L]
> RewriteRule ^site/([0-9]+)$ index.php?section=$1 [L]
>
> first is for displaying articles, second for displaying section
> content.
>
> index.php file is in subdomain.
>
> so my code should look like this:
>
> Code:
>
> RewriteCond %{HTTP_HOST} ^sub\.domain\.com [NC]
> RewriteRule ^site/([0-9]+),([0-9]+)$
> http://sub.domain.com/index.php?section=$1&article=$2 [L]
>
> RewriteCond %{HTTP_HOST} ^sub\.domain\.com [NC]
> RewriteRule ^site/([0-9]+)$ http://sub.domain.com/index.php?section=$1
> [L]
>
> but when I request: http://sub.domain.com/site/39 I get message
>
> The requested URL /site/39 was not found on this server.
>
> So please, help me, how to write code to make it work
>
> P.S.
> sorry for multiposting but I'm desperate ;(
>


Is the DocumentRoot of sub.domain.com the same as domain.com?

In the .htaccess file try something like this (untested):

RewriteCond %{HTTP_HOST} (.*)\.sub\.domain\.com
RewriteRule ^site/([0-9]+)(,([0-9]+))?$ index.php?section=$1&article=$3
[L,NS]

Also, be sure that this rule is above any similar rules in the file that
do not use the RewriteCond statement for it's domain...

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:47 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0