Array
(
)
// Variables OK.
Array
(
[category] => alabama/
)
// Variables OK here too.
Array
(
)
// I would expect the "[category] => alabama" variable to be here too. But surprisingly this works.
Array
(
[category] => alabama
[title] => alabama-state-departments
)
// Variables look OK, but don't redirect when clicked.
Array
(
[category] => alabama
[title] => alabama
)
// what the heck??
Array
(
[category] => alabama
[title] => alabama-public-records
)
// Now see, this Variable looks right, but doesn't work... I'm beginning to think the script doesn't display the correct data on the page because when the category is placed at the beginning of the URL, as a subdomain it's no longer a value of the query? Or does PHP extract query values before mod_rewrite?
Array
(
[category] => alabama
[title] => alabama
[commentspage] => alabama-public-records
)
// This Variable is not right. The comments page should just be a numerical value. /alabama/alabama-public-records/2/ for example.
alabama.domain.com/alabama ... what the heck??
alabama.domain.com/alabama-public-records/ ... Now see, this Variable looks right, but doesn't work... I'm beginning to think the script doesn't display the correct data on the page because when the category is placed at the beginning of the URL, as a subdomain it's no longer a value of the query? Or does PHP extract query values before mod_rewrite?[/code]
alabama.domain.com/
Variables look OK, but don't redirect when clicked.
// This Variable is not right. The comments page should just be a numerical value. /alabama/alabama-public-records/2/ for example.
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?category=%2&title=$1&commentspage=$2 [L]
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?category=%2&title=$1&commentspage=$2 [L]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ index.php?category=$1&title=$2&commentspage=$3 [L]
RewriteRule ^([^/]+)/([^/]+)/([0-9]+)/?$ index.php?category=$1&title=$2&commentspage=$3 [L]
richardk wrote:Why have you go two "alabama"s? I though you wanted to move the alabama, not repeat it. What were you expecting?
<a href="/alabama/alabama-public-records/">link</a>
richardk wrote:You want it to redirect to where, the sub domain?
Actually, if the user clicks on a link while inside the subdomain homepage and it redirects them to that corresponding page back on the main site, thats okay.
<IfModule mod_php4.c>
php_value session.use_trans_sid 0
</IfModule>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]
Rewriterule ^(.*)$ http://www.domain.com/%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} !^$ [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule .* - [L]
RewriteRule ^([a-z_]+)/([^/]+)/?$ /index.php?category=$1&title=$2 [L]
RewriteRule ^([a-z_]+)/([^/]+)/([0-9]+)/?$ /index.php?category=$1&title=$2&commentspage=$3 [L]
RewriteRule ^([a-z0-9_-]+)/([0-9]+)/?$ /index.php?category=$1&articlespage=$2 [L]
RewriteRule ^(.*[^/])/?$ /index.php?category=$1 [L]
You know I'm beginning to think that perhaps I should take the scripts authors advice. Which was that trying to do this is not a good idea.
Users browsing this forum: No registered users and 40 guests