Welcome

Please register to have access to more features!

It is highly recommended that you have Javascript enabled; many features will not work unless you do. The recommended browsers are Firefox and Chrome; the board is also NOT mobile-friendly.

Please invite your friends!

If you were referred by someone (ex. me, Jessica) please put their username in the referral box on the registration page. Ask them if you don't know their username.

If you are visiting for TESTING PURPOSES ONLY, this is the test account information:


Username:
Test
Password: test123



Select a forum to post in:

Pages MOD URL Rewrite

Moderator: Jessica

Pages MOD URL Rewrite

Post Number: #1  Postby Knight Rider » March 6th, 2013, 9:24 pm

Hi guys,

After experimenting between my own board, and a board I'm managing for a friend, I've found a .htaccess rewrite for boards that aren't in the root of the site, and are instead at something like: /forum, or phpBB3.
Whatever the case may be, the code below, should work for the Pages MOD to use: http://yourdomain.com/forumdirectory/yourpagename.
The page.php?p=yourpagename still works, with this rewrite applied.
The rewrite just makes it more convenient. :P

But, in case it doesn't work, be sure, to back up your current .htaccess, and then edit it and add the code.
If it doesn't work, just revert back to the original.
You will have to copy the code below, as the htaccess file extension isn't allowed for upload. :P
Also, in my case, I applied this to the .htaccess file in the root of my site, and not my Forum directory's .htaccess
Enjoy!

Note: I am in no way providing support for this rewrite, therefore always make a back up of your original files before applying file changes.

Code: Select all
#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>

<Files "config.php">
Order Allow,Deny
Deny from All
</Files>

<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
ErrorDocument 400 /error.php?mode=400
ErrorDocument 401 /error.php?mode=401
ErrorDocument 403 /error.php?mode=403
ErrorDocument 404 /error.php?mode=404
ErrorDocument 500 /error.php?mode=500

RewriteEngine on

Rewriterule ^(.+)-f([0-9]*).html-(.+)$            ./viewforum.php?f=$2&$3
Rewriterule ^(.+)-(t|p)([0-9]*).html-(.+)$         ./viewtopic.php?$2=$3&$4
Rewriterule ^(.+)-f([0-9]*)s([0-9]*).html-(.+)$      ./viewforum.php?f=$2&start=$3&$4
Rewriterule ^(.+)-(t|p)([0-9]*)s([0-9]*).html-(.+)$   ./viewtopic.php?$2=$3&start=$4&$5

Rewriterule ^(.+)-f([0-9]*).html$               ./viewforum.php?f=$2&$3
Rewriterule ^(.+)-(t|p)([0-9]*).html$            ./viewtopic.php?$2=$3&$4
Rewriterule ^(.+)-f([0-9]*)s([0-9]*).html$         ./viewforum.php?f=$2&start=$3&$4
Rewriterule ^(.+)-(t|p)([0-9]*)s([0-9]*).html$      ./viewtopic.php?$2=$3&start=$4&$5
RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^([A-Za-z0-9\-\+]+)$ ./page.php?p=$1 [L]
  • 0

Questions about Knight Rider? PM me (I'll answer them ASAP, to the best of my ability)
GTA IV EPS Clan on Facebook
Urgent Message for me?
No matter what Forum, I do not tolerate any type of Spam.
Wanna keep up with my life? ----> My Blog - My Twitter - My Instagram
GTA IV PC Clan?
Right This Way ----> (Access Issues? --> contact@gta-epsclan.ca)
User avatar
Knight Rider
Knight Rider Fan
Topic Author

Global Moderator
Onyx
Onyx
 
7 years of membership7 years of membership7 years of membership7 years of membership7 years of membership7 years of membership7 years of membership
 
Posts: 234
Topics: 54
Joined: February 26th, 2012, 8:53 pm
Local time: March 18th, 2019, 6:44 pm
Last Visit: March 9th, 2019, 10:20 pm
Location: Moderating S&C, my Forums & living life
Gender: Male
Age: 22
Cash on hand: 200.00
Bank: 25,249.36
Reputation: 10
Medals: 8
Best staff member 2013 (1) Graphic Drawing Participant (1) 2 Years (1) 5 Years (1) Referrer (1) Feedback Survey (1) Facebook group (1) Pin-Board (1)
Referrals: 1
Blog: View Blog (92)
Name: Paul
Subject(s): Currently Unavailable
Teacher

Return to Trasℎ Can

Login  •  Register
cron
Reputation System ©'