Print Topic - Archive
E-Blah Community / Forum Updates / mod_rewrite and E-Blah
Posted by: Justin, September 5, 2005, 8:41pm
This thread explains how to have search engine friendly URLs for your forum ...
In the new Blah.pl there is the following two lines:
|
Code
$scriptname = 'Blah.pl';
$modrewrite = '?'; # mod_rewrite: on = ''; off = '?' |
|
Change these lines to:
|
Code
$scriptname = '/forum/';
$modrewrite = ''; # mod_rewrite: on = ''; off = '?' |
|
Notice that I used /forum/ for modrewrite. ?This is because I use a new directory called /forum/ which Apache uses to get /cgi-bin/bb/Blah.pl (nice, I know).
Here's the .htaccess file that is placed in the /forum/ directory:
|
Code
Options All Indexes
IndexOptions FancyIndexing
RewriteEngine On
RewriteBase /forum
RewriteRule ^(.*) /cgi-bin/bb/Blah.pl?$1 |
|
On my server (which uses cPanel) I had to enable indexing for the /forum/ directory (which is doesn't matter as ANYTHING in this directory will be tagged onto Blah.pl).
The way it works is /forum is the base and then in the RewriteRule (.*) is anything after /forum/ (ie: b=cc), that is in turn tagged into Blah.pl (/cgi-bin/bb/Blah.pl?b=cc).
I hope this is all clear. P9.3 isn't set to release for quite some time. But this *better* help search engine results for E-Blah and other forums. ;)
Posted by: Justin, September 6, 2005, 8:31am; Reply: 1
Someone with a busy forum -- PLEASE try this mod (ask me for the source code!)
Posted by: mealybar, October 6, 2005, 12:43pm; Reply: 2
Did this mod get tested out? I note the url changes in my new 9.3 install, but have a few errors I think because my 'Blah.pl?' part of the url is still there?
Message Forum catagory doesnt always show when the board index is loaded. Press refresh and it all comes right again! Strange eh!
http://www.pigeonbasics.com/forum/blah/Blah.pl
Posted by: Martin, October 6, 2005, 1:10pm; Reply: 3
Have you edited your .htaccess to include
|
Code
Options All IndexesIndex Options FancyIndexing RewriteEngine On RewriteBase /forumRewriteRule ^(.*) /cgi-bin/bb/Blah.pl?$1
|
|
Posted by: mealybar, October 6, 2005, 5:04pm; Reply: 4
I hadnt, but I've now tried and cant seem to get the right folder to put it into. Tried both forum/, blah/, but only comes up with 500 errors. Any ideas?
Posted by: Justin, October 6, 2005, 6:39pm; Reply: 5
Some servers are very trivial with mod_rewrite. I don't know enough about mod_rewrite, truth be told. I know that I keep my /forum/ directory clean (nothing but .htaccess is in it). I keep everything else in /cgi-bin/{forum} directory. Hope this helps?
Posted by: mealybar, October 6, 2005, 7:25pm; Reply: 6
Think I'm muddled with where you put your htaccess, forum is a virtual folder already being rewritten to cgi-bin/bb/ ?
P.S the sitemap generator works a treat :) - well once I get these urls sorted out!
Oh aye, any thoughts on the problems with the category display? I've tried it on two different machines, firefox only seems to have the problem, but then a refresh sorts it out!
Posted by: Justin, October 6, 2005, 7:27pm; Reply: 7
I have an update sitemap gen I should post ... it adds the dates so Google can index you better. :P I'll post it soon.
If you PM me or IM me some FTP login info I'll try to fix it up for ya.
Posted by: mealybar, October 7, 2005, 3:43am; Reply: 8
Think I got it working (the mod rewrite). The funny error thing, I think its in the login script, it redirects you to forum/blah//b=/m-//, so I think its the double forwardslash. Tried to find it in the code, but whatever I edit I get errors.lol
Posted by: Martin, October 7, 2005, 4:15am; Reply: 9
Posted by: mealybar, October 7, 2005, 8:07am; Reply: 10
Thanks, it didnt have a tralling slash; but when I pop one in it seems to use the correct urls now.
I'm still getting the message category not dispaying right, as I said it looks like only Firefox, but it clears up once you press refresh. I've tried it on a few different machines to see if it was just mine, but all same. I'll try and attach a photo of it.
Posted by: Justin, October 7, 2005, 10:21am; Reply: 11
Yeah, that was an issue. If you open up BoardIndex.pl you can remove all the <col> (I think that's it) and it should fix it for you.
Posted by: mealybar, October 7, 2005, 1:54pm; Reply: 12
Thanks Justin, that seems to have put it right :)
Posted by: Tim Linden, October 8, 2005, 9:30am; Reply: 13
Posted by: Tim Linden, October 8, 2005, 9:38am; Reply: 14
Ok long version:
1) I use modrewrite extensively. The folders I use do not exist at all. For example:
http://www.clixnetwork.com/products/traffic-exchange/ There is no folder "products". You don't need to create one.
2) I downloaded the zip with eblah in it and it doesn't have those options.
3) I'm hot, humid, hungry, and just want it to work with mod rewrite but I may just do it the old fashioned way and ping you.
Posted by: Justin, October 8, 2005, 12:06pm; Reply: 15
Quoted from xxclixxx
Ok long version:
1) I use modrewrite extensively. The folders I use do not exist at all. For example:
http://www.clixnetwork.com/products/traffic-exchange/ There is no folder "products". You don't need to create one.
2) I downloaded the zip with eblah in it and it doesn't have those options.
3) I'm hot, humid, hungry, and just want it to work with mod rewrite but I may just do it the old fashioned way and ping you.
You've got to use 9.3.
I've grown fond of rewrite too .... I've changed all my links on eblah.com to be like {whatever}.php when it's really ?v=whatever.php :P.
Posted by: thanetm, October 18, 2005, 8:15am; Reply: 16
i've got the mod_rewrite working, and everything is hunkydory if you go to
http://www.smallcarsbighearts.co.uk/soapbox/However, if you take that last '/' off it shows information in the address bar that i don't want people to see.
Any ideas what is going on?
Also, after adding this mod, when people registered the link in the e-mail to validate their address didn't work, so i updated the forum url in the admin settings, but couldn't put a forward slash on the end, so had to go into one of the files (can't remember which one now!) and edit the code. Just thought i would mention it in case other people had the same problem ;D
ta muchly!
Posted by: Justin, October 18, 2005, 11:57am; Reply: 17
Hmmm ... did you change anything to make it redirect to that page instead of act like an internal link or whatever. I'm not too knowledgable about mod_rewrite, maybe someone else can better help?
Posted by: Justin, October 19, 2005, 11:16pm; Reply: 18
Run the upgrade, it gets rid of the dash in the username for you.
Posted by: riffplayer, October 21, 2005, 9:54am; Reply: 19
Quoted from thanetm
i've got the mod_rewrite working, and everything is hunkydory if you go to
http://www.smallcarsbighearts.co.uk/soapbox/However, if you take that last '/' off it shows information in the address bar that i don't want people to see.
Any ideas what is going on?
Also, after adding this mod, when people registered the link in the e-mail to validate their address didn't work, so i updated the forum url in the admin settings, but couldn't put a forward slash on the end, so had to go into one of the files (can't remember which one now!) and edit the code. Just thought i would mention it in case other people had the same problem ;D
ta muchly!
I've been doing some research on mod_rewrite and here's something I found that might help:
Quoted Text
Adding Trailing Slashes
If your site visitor had entered something like products/12, the rule above won’t do a redirect, as the slash at the end is missing. To promote good URL writing, we’ll take care of this by doing a direct redirect to the same URL with the slash appended.
RewriteRule ^products/([0-9][0-9])$ products/$1/ [R]
Multiple redirects in the same .htaccess file can be applied in sequence, which is what we’re doing here. This rule is added before the one we did above, like so:
RewriteRule ^products/([0-9][0-9])$ products/$1/ [R]
RewriteRule ^products/([0-9][0-9])/$ productinfo.php?prodID=$1
Thus, if the user types in the URL products/12, our first rule kicks in, rewriting the URL to include the trailing slash, and doing a new request for products/12/ so the user can see that we likes our trailing slashes around here. Then the second rule has something to match, and transparently redirects this URL to productinfo.php?prodID=12. Slick.
You can see this and more info about Mod Rewrite at this website:
http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
Posted by: Justin, October 21, 2005, 3:35pm; Reply: 20
Posted by: Justin, October 21, 2005, 3:37pm; Reply: 21
I really don't think that's what it is.
Posted by: thanetm, October 22, 2005, 1:30pm; Reply: 22
it doesn't seem to work - i'm guessing because of the RewriteBase - which is the 'madeup' bit, so isn't an actual path to redirect...
course i have absolutely no idea what i'm talking about - nothing new there!! :D
Posted by: goober99, November 3, 2005, 12:00am; Reply: 23
I already use mod_rewrite on my website also, and I normally deal with directories that don't exist. I have E-Blah installed in
/E-Blah (not in the cgi-bin). I installed 9.4 and changed the lines in
Blah.pl to use mod_rewrite. Then I dropped the following line into my
.htaccess file in my root web folder, and everything works great:
|
Code
RewriteRule ^forum/*(.*)$ e-blah/Blah.pl?$1 |
|
Posted by: Justin, November 23, 2005, 2:59pm; Reply: 24
I just thought I'd mention that after doing this Google has indexed about 75% of EBlah.com. ;)
Posted by: will, November 23, 2005, 4:26pm; Reply: 25
Right i almost have this working. One major problem....
http://wrestling.forum300.com/forum/ .......what ever i click takes me back to the main page again. Cannot access any of the forums or anything it simply keeps me on the blah.pl page. How do i overcome this problem?.
Posted by: Justin, November 23, 2005, 5:20pm; Reply: 26
In Blah.pl make it /forum/ not forum
Posted by: will, November 23, 2005, 6:06pm; Reply: 27
Quoted from admin
In Blah.pl make it /forum/ not forum
Ive done that its still doing the same thing for me. Its not going to the right files its looking in the forum folder for the files..... :-/
Posted by: will, November 24, 2005, 6:44am; Reply: 28
Another thing ive noticed is that if i goto the url
http://wrestling.forum300.com/forum and dont put the / on the end of forum i get a different thing altogether. I get the same main page but then i click the link i get this error -
Not Found
The requested URL /Blah.pl was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.34 Server at wrestling.forum300.com Port 80
Any ideas?
Posted by: Craig, November 24, 2005, 6:58am; Reply: 29
Ok, I got it working. For what ever reason, my Forum address needs to be:
http://www.blahdocs.com/forum/not:
http://www.blahdocs.com/forumfor my News to work right on my main page. If I don't have that trailing slash in there, the links show like this:
http://www.blahdocs.com/forumm-somenumber/instead of:
http://www.blahdocs.com/forum/m-somenumber/This would be fine, but when I save settings in my admin center, it always removes that trailing slash. Yes I can edit the Settings.pl file, but anytime I save settings after that in my admin center, this will change back to no slash :o.
Justin, did you put something in the code that removes this slash? If so, can you get rid of that / tell me where to find it so I can fix this problem...please:)
-Craig.
Posted by: thanetm, November 24, 2005, 10:17am; Reply: 30
i have all the same problems as craig! i get it working by butchering my way through various files, but then when there's an update to the forum, i have to try and remember what i changed and where!!
it's been a good learning experience though!!
Posted by: will, November 24, 2005, 10:20am; Reply: 31
Ive got my wrestling site working on this now.
I am trying to get my christian site working on this idea now.
I am getting the old internal server 500 error. What it strange is the code all matches and the chmods are all fine (ive checked via smartftp and via cpanel to be sure!) so i dont know whats going on now. Anyone any ideas the url im working on now is
http://www.followers-inn.com/forums it seems to be going to the right place (as in when i goto the full url to the blah.pl script i also get the 500 error). Its as if the chmod is wrong but ive checked it and its not.
Posted by: Justin, November 24, 2005, 10:41am; Reply: 32
Some servers don't allow that .htaccess to work.
Posted by: Craig, November 24, 2005, 3:10pm; Reply: 33
Quoted from admin
Some servers don't allow that .htaccess to work.
Hey! Don't forget my problem on page 2.
Posted by: Justin, November 24, 2005, 3:12pm; Reply: 34
I donno that you can get rid of the slash, Craig? I don't know much about mod_rewrite. :-/
Posted by: Craig, November 24, 2005, 3:17pm; Reply: 35
Nooooo. When I save my settings in the admin center, it removes the trailing / from the end of the Forum address. Why?...and yes, Settings.pl is chmod'd to 666.
Posted by: Justin, November 24, 2005, 3:20pm; Reply: 36
Ohhh, because it's supposed to if you have enabled mod_rewrite. :)
Posted by: Craig, November 24, 2005, 3:24pm; Reply: 37
Ok, then explain to me why your news on your home page works for you when you click on the message title, but when I do it on mine it doesn't work. For what ever reason, I need that / at the end of the forum address.
Posted by: will, November 24, 2005, 3:59pm; Reply: 38
Quoted from admin
Some servers don't allow that .htaccess to work.
Its the same company and servers as the wrestling site. Also when i goto the full blah.pl url i get the 500 error. Ive checked the chmod and its fine im confused about this problem. :-/
Posted by: Justin, November 24, 2005, 10:08pm; Reply: 39
Can you view the error logs?
Posted by: will, November 25, 2005, 4:08pm; Reply: 40
Yep -
[2005-11-24 19:28:03]: error: directory is writable by others: (/home/will/public_html/cgi-bin/forum)
[2005-11-24 17:00:55]: error: directory is writable by others: (/home/will/public_html/cgi-bin/forum)
[2005-11-24 17:00:44]: error: directory is writable by others: (/home/will/public_html/cgi-bin/forum)
[2005-11-24 17:00:38]: error: directory is writable by others: (/home/will/public_html/cgi-bin/forum)
Checked both the cgi-bin and forum chmod and both are at 755.
Posted by: Justin, November 25, 2005, 4:18pm; Reply: 41
Try CHMODing /forum/ 555. I'm really not sure?
Posted by: will, November 26, 2005, 4:07pm; Reply: 42
That sorted the problem. Thats a strange one like. Thanks.
Posted by: sundance, December 12, 2005, 10:04am; Reply: 43
Quoted from scrappy
Ok, then explain to me why your news on your home page works for you when you click on the message title, but when I do it on mine it doesn't work. For what ever reason, I need that / at the end of the forum address.
so did i...
I had to add the trailing slash to get the validation links to work properly in the emails.
Posted by: Craig, December 12, 2005, 10:50am; Reply: 44
Quoted from sundance
so did i...
I had to add the trailing slash to get the validation links to work properly in the emails.
Yeah, I am still waiting for an answer on this one:)
Posted by: sundance, December 12, 2005, 12:53pm; Reply: 45
oh... good. i just sent you a PM before reading this asking if it was still an issue.
btw, adding the trailing slash, while it fixed the Password Change and Forum Validation links in emails... sigh... I'm back to having two slashes in the Admin's validation New Member email. The link looks like this:
http://mydomain.com/forum//Blah.pl?v=admin,a=validate
With mod_rewrite ON, I'm guessing it probably shouldn't be adding the Blah.pl in these links either.
maybe this might be a hint to the problem... hoping.
Posted by: Justin, December 12, 2005, 5:50pm; Reply: 46
Save your Directory settings after you make the changes. Also make sure you make the changes CORRECTLY to Blah.pl.
Posted by: Craig, December 13, 2005, 1:26pm; Reply: 47
Justin, you have access to my blahdocs.com ftp. Can you take a look at it and let me know what I have done wrong. If I take the / off the end of the forum address, then the news on the main page doesn't work.
Posted by: sundance, December 14, 2005, 5:54am; Reply: 48
Quoted from sundance
.htaccess looks like this:
|
Code
Options All Indexes IndexOptions FancyIndexing RewriteEngine On RewriteBase /forum RewriteRule ^(.*) /cgi-bin/bb/Blah.pl?$1 |
|
And the lines in Blah.pl looks like this:
|
Code
$scriptname = '/forum/'; $modrewrite = ''; # mod_rewrite: on = '' | off = '?'
|
|
And the setting for the Global url looks like this:
|
Code
$realurl = "http://mydomain.com/forum"; |
|
My observations with these settings are:
- News - /forum/forum inside the thread topic, Read Comments, Click here to read more links... but the links work. All other links on the portal page are fine.
- Change Password email - /forum/forum inside the links... but the links work.
- Forum Validation email - /forum/forum inside the links... but the links work.
- PM notification email - /forum/forum inside the links... but the links work.
- New Reply notification email - /forum/forum inside the links... but the links work.
- New Member email - /forum/Blah.pl and /forum/Blah.pl?v=admin,a=validate inside the links... but the links work.
Is it supposed to look this way? And why is it only showing
/forum/forum on selected links instead of all links?
Posted by: Justin, December 14, 2005, 10:32am; Reply: 49
Let me have your FTP info and I'll fix it for you.
Posted by: Craig, December 14, 2005, 1:23pm; Reply: 50
Ok, I finally got it. Here it is, and I think this has already been said in the other post, but it just hit me like a brick!
Edit Blah.pl and change the $scriptnae and $modrewrite to this:
|
Code
$scriptname = '/forum/'; $modrewrite = ''; # mod_rewrite: on = '' | off = '?' |
|
Now create a folder on your server at your root called forum and put an .htaccess file in it. The contents of this .htaccess file should be this:
|
Code
Options All Indexes IndexOptions FancyIndexing
RewriteEngine On
RewriteBase /forum
RewriteRule ^(.*) /cgi-bin/bb/Blah.pl?$1
|
|
This is assuming that your forum is installed in a folder under your cgi-bin folder called
bb. If your forum is installed in a different directory then change that setting to the approiate name.
Now edit your
Forum Address (URL): via your admin center or by editing your Settings.pl file and change the address to your forum to this:
http://www.yoursite.comNote: use your read site address instead of yoursite. Also note that you should not put a
/ at the end.
That should work on any UNIX box that allows you to use mod-rewrite.
Posted by: thanetm, December 14, 2005, 2:45pm; Reply: 51
fantastic! that worked! Thank you.
Posted by: sundance, December 14, 2005, 6:34pm; Reply: 52
Whoo-hoo!!
i couldn't figure out where that extra /forum was from.
THanks Much!
that fixed everything!!!!! If i could up your rep i would... but i already did some time ago :D
Posted by: rastoma, January 7, 2006, 11:23pm; Reply: 53
thanks craig for going over that again. i know it's basically the same thing that Justin posted, but the location of the forum directory threw me off. I thought I was suppose to put it inside my cgi-bin directory.
but something has happened that's strange since this rewrite deal.
when i first load the forum the first time either typing the url or clicking on the link from my main site, I get an error in IE in the bottom left that when clicked on says:
Line: 167
Char: 4
Error: 'swdith' is undefined
Code: 0
URL: (lists my main url)
when i click on a topic and additional postings the error goes away, until I go back to home (home on the forum).
FF doens't show any errors.
i don't remember seeing this before making the modrerite changes
Posted by: BadOscar, January 14, 2006, 6:44pm; Reply: 54
Just upgraded from version 9.2 and the Password Change and Forum Validation links in emails were missing a forward slash. So they would not work.
|
Code
In QuickCore.pl sub CheckCookies
the line (v9.2): $rurl = "$realurl/$scriptname?";
has been changed to (v9.6): $rurl = "$realurl$scriptname"; if($modrewrite eq '?') { $rurl .= $modrewrite; }
added back in the forward slash and all is well now: $rurl = "$realurl/$scriptname"; if($modrewrite eq '?') { $rurl .= $modrewrite; }
|
|
Is this a bug for those not using the mod_rewrite, or should I fix it another way?
Posted by: Justin, January 14, 2006, 7:52pm; Reply: 55
Actually, it was a problem with the first post (which I just edited).
Change the following in Blah.pl:
|
Code
$scriptname = ''; $modrewrite = '/forum/'; # mod_rewrite: on = '' | off = '?' |
|
To:
|
Code
$scriptname = '/forum/'; $modrewrite = ''; # mod_rewrite: on = '' | off = '?' |
|
Then go to Admin/Settings and click "Save" (view all settings). This SHOULD fix your problem. It's undocumented stuff, really. I should document more, but I'm bad at it. Craig does a pretty good job at keeping things up to date, but there's a lot of stuff I add that I think he doesn't see right away. :P
Posted by: BadOscar, January 15, 2006, 11:05pm; Reply: 56
That looks correct, but it does not fix the bug that exists if you are NOT using mod_rewrite. If you fix the bug, well, then your code above will not work again. Read my post again, you will see what i mean. I think you will want to fix it.
Posted by: Justin, January 15, 2006, 11:19pm; Reply: 57
Oh, you didn't enable mod_rewrite? Then just go and save your settings. It adds an extra slash for you when you save it (thus fixing your little problem). :)
Posted by: BadOscar, January 16, 2006, 1:30pm; Reply: 58
;D Hey it says it right on that screen too...
"If the mod_rewrite modification is turned OFF, you should add a trailing slash here."
Must have missed that. All the settings were right so I never hit save when I upgraded.
Thanks very much Justin. I really like the code it was so easy to mod and get exactly what I wanted for a custom portal on my site.
Posted by: Asharad, February 8, 2006, 6:45pm; Reply: 59
I'm still struggling with this thing. mod_rewrite works on my site. I tested with a simple redirect from one directory to another. But when I follow the instructions above I get errors.
Posted by: Asharad, February 8, 2006, 7:18pm; Reply: 60
Ok... now this is odd. I got it working, but I didn't change my settings.pl. It still has the / at the end of the address. And when I mod Blah.pl I had to chmod it to 755 everytime. The mod was borking my chmod.
Posted by: Martin, February 24, 2006, 4:25am; Reply: 61
Thought it time I had a go at this, it works but I have one problem, take a look:
http://www.cheapestutilities.biz/forumNotice the address in the address bar.
If then click on the Home button it displays correctly.
This is my .htaccess
Options All Indexes
IndexOptions FancyIndexing
RewriteEngine On
RewriteBase /forum
RewriteRule ^(.*) /cgi-bin/forum/Blah.pl?$1
Any ideas
Posted by: thanetm, February 24, 2006, 5:03am; Reply: 62
i have the same problem - if you don't put a trailing slash on the end it shows all that information you'd rather was hidden.
Use:
http://www.cheapestutilities.biz/forum/and it behaves itself! i don't think anyone has answered why this is yet, and i just don't know enough about it!!
Posted by: Justin, February 24, 2006, 10:24am; Reply: 63
I'm not sure either. :-/
RewriteBase /forum
Try:
RewriteBase /forum/
Not sure
Posted by: Martin, February 24, 2006, 1:33pm; Reply: 64
Thank's thantetm, this works.
Tried what you suggested Justin but still get the same, off to scour the web
Posted by: Craig, February 24, 2006, 4:18pm; Reply: 65
I am guessing that this is a server issue because it is not a problem on my 1and1 account.
Posted by: Craig, February 24, 2006, 4:18pm; Reply: 66
Quoted from thanetm
i have the same problem - if you don't put a trailing slash on the end it shows all that information you'd rather was hidden.
Use:
http://www.cheapestutilities.biz/forum/and it behaves itself! i don't think anyone has answered why this is yet, and i just don't know enough about it!!
Works like a charm.
Posted by: Apollo, February 27, 2006, 4:53am; Reply: 67
Admit up-front I'm not familiar with mod_rewrite, but have started to have a look.
The trailing slash seems to be a consistent problem in the above posts, apparently sometimes needed, sometimes not,and I wonder if this is any help in consistently handling it's existence or absence in the original url:
Quoted Text
Adding Trailing Slashes
If your site visitor had entered something like products/12, the rule above won’t do a redirect, as the slash at the end is missing. To promote good URL writing, we’ll take care of this by doing a direct redirect to the same URL with the slash appended.
RewriteRule ^products/([0-9][0-9])$ products/$1/ [R]
Multiple redirects in the same .htaccess file can be applied in sequence, which is what we’re doing here. This rule is added before the one we did above, like so:
RewriteRule ^products/([0-9][0-9])$ products/$1/ [R]
RewriteRule ^products/([0-9][0-9])/$ productinfo.php?prodID=$1
Thus, if the user types in the URL products/12, our first rule kicks in, rewriting the URL to include the trailing slash, and doing a new request for products/12/ so the user can see that we likes our trailing slashes around here. Then the second rule has something to match, and transparently redirects this URL to productinfo.php?prodID=12. Slick.
Posted by: Craig, February 27, 2006, 3:35pm; Reply: 68
Posted by: Apollo, February 27, 2006, 10:00pm; Reply: 69
It's just an offering. As I noted, mod_rewrite is something I only looked at yesterday as it has appeared in another package I use, as a means to hide the 'dirty' urls with stuf like ?action=edit from users, and rewrite them in convential tree form.. I rememberd watching this thread with assorted problems being 'fixed' by playing with trailing / after seeing the above snippet that allows mod_rewrite to work as intended with or without the trailing / in place.
Whether or not it's any use is, of course, another question :)
Posted by: thanetm, February 28, 2006, 3:22am; Reply: 70
i had a bit of a play with it on my lunch break yesterday. problem is - mod_rewite is being used in my case to create a new directory name ie instead of using /forum/Blah/Blah.pl i'm using mod_rewrite to create /soapbox/.
So i haven't figured yet how to implement the other check to add the trailing slash, because until you've done the first rule the /soapbox problem doesn't exist. (i'm not sure if that makes sense) I tried various things and none of them worked :(
i haven't given up yet...
Posted by: mealybar, January 22, 2007, 7:19pm; Reply: 71
Is there a way of upgrading without having to turn off the mod_rewrite? -- I have to turn it off to run the Setup.pl file
Posted by: Justin, January 22, 2007, 7:44pm; Reply: 72
What? You don't have to turn anything off, just change it in Blah.pl, run Setup.pl from your main installation directory.
Posted by: mealybar, January 23, 2007, 7:27pm; Reply: 73
My understanding of the code in the htaccess file was that anything after the domain.com/forum/<here> would be rewritten to domain.com/forum/Blah.pl?<here> in such case running the setup file (domain.com/forum/Setup.pl) wouldnt work would it?
Posted by: Justin, January 23, 2007, 7:29pm; Reply: 74
It should, but you'll have to tell Apache NOT to run the rewrite if Blah.pl is run (or else it'd loop out).
Posted by: Ryan, March 22, 2007, 2:26pm; Reply: 75
I'm totally crap at modrewrite... anyone want to help? Trying to make it happen in the directory eblah is installed, instead of on a different directory.
So instead of
/cgi-bin/forum/Blah.pl forwarding to:
/forum/
I want it to be like:
/forum/ and have the installation IN that directory.
The following works... but the css doesn't. Any ideas?
|
Code
Options All Indexes
IndexOptions FancyIndexing
RewriteEngine On
RewriteBase /ndnbloggers
RewriteRule ^(.*) Blah.pl?$1 |
|
Posted by: Craig, March 22, 2007, 3:10pm; Reply: 76
With E-Blah, I don't think you can do it. I have tried, and it won't work.
Posted by: whiskymac, March 23, 2007, 10:51am; Reply: 77
Not quite sure if I've interpreted this the right way but mine is set so that the install is just in /forum/ not in a cgi-bin. I use mod_rewrite so instead of http://www.breathemini.co.uk/forum/Blah.pl it is just http://www.breathemini.co.uk/forum
Use the following for the mod_rewrite to get this to work
|
Code
Options All Indexes
IndexOptions FancyIndexing
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/forum/Blah.pl
RewriteBase /forum
RewriteRule ^(.*) /forum/Blah.pl?$1 |
|
Hope thats what you meant, if not, ignore it!
Posted by: Justin, March 23, 2007, 12:36pm; Reply: 78
That's correct. You can also do:
RewriteCond %{REQUEST_FILENAME} !-f
Which will make it work also.
Posted by: Ryan, March 26, 2007, 4:09pm; Reply: 79
I just tried that... and it stopped the css from working :-/
Posted by: Justin, March 26, 2007, 4:16pm; Reply: 80
What's the error Apache returns for the .css file?
Posted by: Ryan, March 26, 2007, 4:54pm; Reply: 81
Just checked the error logs in cpanel... nothing there at all about anything.css
Posted by: Ryan, March 30, 2007, 10:21pm; Reply: 82
It does work... but the css doesn't. For now, I moved the css outside of the forum directory. Anyone got any idea on how to achieve this whilst keeping the blahdocs INSIDE the forum directory?
Posted by: will, May 20, 2007, 10:52am; Reply: 83
I am trying this again....i am having a problem i sorted before but now i have no idea how i did it....
http://www.the12z.com/forums it loads fine no problems but all the links just point to the main page (if you click the forum it loads the index page despite the url changing). I have the eblah.pl file as '/forums/' so thats not the problem. Im confused. Anyone any idea whats up. I checked error logs there is nothing reported about this.
Posted by: Martin, May 20, 2007, 1:10pm; Reply: 84
This is the theme and the fact you are using modrewrite, you need to edit template.html and take out the Blah.pl? from the menu links apart from the Home link.
Print page generated: December 3, 2008, 3:30pm