| Coding Forum Problems with your code? Let's hear about it. |
07-21-2006, 12:01 AM
|
#1 (permalink)
|
|
Potato Monster
Join Date: 03-26-04
Location: Chester, England
Posts: 3,869
|
.htaccess redirect problem..!
I need to redirect via fake subomains on a website using mod_rewrite however its not working properly which is likely because I dont know what im doing.
Its a wordpress blog so if you know about wordpress you will recognise the %xxx% bits below.
http:%category%.mydomain.com/%author%/%postname%/
That is how I would like it to appear but its not working.
At the moment I have it setup as:
/%category%/%author%/%postname%/
and the .htaccess file read as follows.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Any help appreciated...
__________________
I have become death, destroyer of worlds.
|
|
|
07-26-2006, 10:09 AM
|
#2 (permalink)
|
|
Contributing Member
Join Date: 05-30-06
Location: Canada
Posts: 458
|
Hi,
your hosting may not have enabled mod_rewrite apache module for customers.
Svet
|
|
|
07-28-2006, 01:48 PM
|
#3 (permalink)
|
|
Potato Monster
Join Date: 03-26-04
Location: Chester, England
Posts: 3,869
|
Its my server, it is installed as it is currently working however I am not savvy enough with htaccess to get it working.
__________________
I have become death, destroyer of worlds.
|
|
|
07-29-2006, 01:06 PM
|
#4 (permalink)
|
|
Contributing Member
Join Date: 05-30-06
Location: Canada
Posts: 458
|
hi,
put the code you're showing here in an .htaccess where your wordpress installed.
if your web server is apache2 you may prefix RewriteBase / with "#"
post latest errors from apache log file using "tail" command.
as I understand mod_rewrite rules, all requests will be passed through index php if such file does not exist.
you need also to set up a catch-all dns to handle all requests to your subdomains
or create each subdomain when creating a new category.
Svet
|
|
|
07-29-2006, 01:46 PM
|
#5 (permalink)
|
|
Potato Monster
Join Date: 03-26-04
Location: Chester, England
Posts: 3,869
|
The one above is what im using at the moment, it works just I need it changing so it shows as a subdomain.
__________________
I have become death, destroyer of worlds.
|
|
|
07-30-2006, 02:13 PM
|
#6 (permalink)
|
|
Contributing Member
Join Date: 05-30-06
Location: Canada
Posts: 458
|
Hi,
I am not familiar with this blog yet, but I think you should check the bog's configuration and setup respective subdomains.
Svet
|
|
|
07-31-2006, 06:46 AM
|
#7 (permalink)
|
|
Inactive
Join Date: 06-16-06
Posts: 268
Latest Blog: None
|
Immo,
Instead of mucking around with the .htaccess, just update your 'permalink structure' in your Wordpress admin area by clicking Options.. then permalink options. And put in mydomain.com in the structure there. Have you tried that?
I used that a few days ago to put a .html at the end of all blog posts in my blog, and it worked fine.
Last edited by ali_420 : 07-31-2006 at 06:51 AM.
|
|
|
08-01-2006, 09:39 AM
|
#8 (permalink)
|
|
Potato Monster
Join Date: 03-26-04
Location: Chester, England
Posts: 3,869
|
I tried mucking around with the control panel but it wont do it, ive got to get htaccess to work somehow... Either that or I just modify the code manually but that takes time...
Ill figure something out.
__________________
I have become death, destroyer of worlds.
|
|
|
08-01-2006, 09:42 AM
|
#9 (permalink)
|
|
Southern Brat
Join Date: 10-13-03
Location: Texas
Posts: 15,700
|
Do you have permissions set high enough on the .htaccess file to allow the control panel to make the changes for you?
|
|
|
08-01-2006, 09:53 AM
|
#10 (permalink)
|
|
Potato Monster
Join Date: 03-26-04
Location: Chester, England
Posts: 3,869
|
Yes but it doesnt work, it makes the link appear like this:
http://http://category.domain.ext/folder/subfolder/
I just need to find a way to get it working but I guess I am going to have to hard code it and rewrite the PHP. Shouldnt take long I was just hoping there was an easier way.
__________________
I have become death, destroyer of worlds.
|
|
|
08-01-2006, 10:13 AM
|
#11 (permalink)
|
|
Inactive
Join Date: 06-16-06
Posts: 268
Latest Blog: None
|
Immo,
I think you need to chmod the .htaccess to 777 and then try to update the permalink structure in wordpress. After you update it you can always chmod .htaccess back to whatever you need.
Give it a shot and get back to me 
|
|
|
08-01-2006, 10:15 AM
|
#12 (permalink)
|
|
Inactive
Join Date: 06-16-06
Posts: 268
Latest Blog: None
|
edit: double post
Last edited by ali_420 : 08-01-2006 at 10:31 AM.
|
|
|
08-01-2006, 10:24 AM
|
#13 (permalink)
|
|
Potato Monster
Join Date: 03-26-04
Location: Chester, England
Posts: 3,869
|
No that doesnt work, when you change it in wordpress it does the links as I posted above, if needs to be done manually, wordpress cant do it.
__________________
I have become death, destroyer of worlds.
|
|
|
08-01-2006, 04:34 PM
|
#14 (permalink)
|
|
Inactive
Join Date: 06-16-06
Posts: 268
Latest Blog: None
|
Hey Immo,
In that case, why don't you just add the subdomains manually and point them to the www.yoursite/blog/category/? Isn't that possible?
|
|
|
08-01-2006, 11:37 PM
|
#15 (permalink)
|
|
Potato Monster
Join Date: 03-26-04
Location: Chester, England
Posts: 3,869
|
That would defeat the object of having subdomains, I want everything categorised by subdomain not subfolder.
This is going to be a painful process getting it to work, I can see it now 
__________________
I have become death, destroyer of worlds.
|
|
|
08-02-2006, 12:41 AM
|
#16 (permalink)
|
|
Inactive
Join Date: 06-16-06
Posts: 268
Latest Blog: None
|
Immo,
I'd say go to sitepoint.com and post this in the PHP forums out there. You're certain to find out whats the problem over there. I don't do work with regexps/mod_rewrite so I can't tell you how to fix this, but there are my coders over there who can.
|
|
|
08-03-2006, 04:02 AM
|
#17 (permalink)
|
|
Potato Monster
Join Date: 03-26-04
Location: Chester, England
Posts: 3,869
|
Ill figure it out, there are a few people here who can help. I would rather figure it out that someone hand the answer to me on a plate, at least then I will remember for next time.
Thanks for trying to help though.
__________________
I have become death, destroyer of worlds.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|