Switching to Static URL's...

Status
Not open for further replies.

tproductions484

New Member
Messages
17
Reaction score
0
Points
0
Hello.
I currently have a dynamic URL
(http://mysite.x10.mx/mybb/member.php?action=profile&uid=1)

And I want to switch to static URL's
(http://mysite.x10.mx/mybb/user-1.html)

Yet, all of the php I have trie in my .htaccess in the root of my site (/public_html/.htaccess "is the location of my file") And my forum install (MyBB) is located in: (public_html/mybb/). So, can someone please tell me, to change to static url's, what code do I have to put into my .htaccess for my url's to work as static url's? I get a 404 error when I try one of these:


PHP:
Options +Multiviews 

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

PHP:
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} !mod= [NC]
RewriteRule ^([^/]+)$ /index.php?mod=$1 [L]

Please help.
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Hello,

As from what you've said I gather your site to be run by a MyBB script, I suggest you consult their support. They will be able to give you more specialist advice.
 

tproductions484

New Member
Messages
17
Reaction score
0
Points
0
Hello,

As from what you've said I gather your site to be run by a MyBB script, I suggest you consult their support. They will be able to give you more specialist advice.
Yes, but I do not know all of the optimized settings on x10hosting, and neither would MyBB, so, as one last question, is there any prefix that I have to place before the code or something such as

PHP:
RewriteBase /

or would it be

PHP:
RewriteBase /mybb/

Because the script isn't installed into the root, there is it's own directory... (public_html/mybb/)
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Hello,

RewriteBase / should be placed immediately below RewriteEngine On in your .htaccess.
 

tproductions484

New Member
Messages
17
Reaction score
0
Points
0
Okay, my .htaccess is supposed to include this:

PHP:
Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
	# Turn off mod_security filtering.
	SecFilterEngine Off

	# The below probably isn't needed, but better safe than sorry.
	SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
	RewriteEngine on
        RewriteBase / 
	RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
	RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]

	RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
	RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
	RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
	RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]

	RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]

	RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]

	RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]

	RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

	RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]

	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE application/javascript text/css text/html text/xml
</IfModule>
And I still get 404 errors when I try to access pages on the site! But when I remove the code, the site works! So, can someone please edit this code to what would work for MyBB and x10hosting options (such as RewriteBase / needed, as well as maybe other things like that).

If this helps, MyBB is uploaded into this directory: "public_html/mybb/"
Do I maybe have to change "RewriteBase /" to "RewriteBase /mybb/"?
 
Last edited:

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Hello,

You will need to change it to RewriteBase /mybb/ as you stated above, since your forum is in the /mybb directory.
 

tproductions484

New Member
Messages
17
Reaction score
0
Points
0
It STILL DOESN'T WORK. I still keep getting 404's. Would I have to change ANY OF THE LINKS OF THIS CODE? Considering that it is installed in public_html/mybb/?

PHP:
Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
	# Turn off mod_security filtering.
	SecFilterEngine Off

	# The below probably isn't needed, but better safe than sorry.
	SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
	RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]

	RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
	RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
	RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
	RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]

	RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]

	RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]

	RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]

	RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

	RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]

	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE application/javascript text/css text/html text/xml
</IfModule>
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
You took out the RewriteBase...

Should look like the following under the <IfModule mod_rewrite.c> line
Code:
RewriteEngine On
RewriteBase /mybb/
 

tproductions484

New Member
Messages
17
Reaction score
0
Points
0
You took out the RewriteBase...

Should look like the following under the <IfModule mod_rewrite.c> line
Code:
RewriteEngine On
RewriteBase /mybb/
That just gives me a 500 error... OMG. Does x10hosting not support this feature or something? I'm doing exactly what you day.
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Oh, just noticed your first post -- you need to move that .htaccess file into the mybb directory
 

tproductions484

New Member
Messages
17
Reaction score
0
Points
0
Oh, just noticed your first post -- you need to move that .htaccess file into the mybb directory
Really good thinking, but when I do that... The MyBB director doesn't show up! Omfg. Thanks for your help but I just cant seen to understand why this isn't working...

---------- Post added at 06:25 AM ---------- Previous post was at 06:19 AM ----------

I moved the .htaccess file to this: "public_html/MyBB/" and, the site works fine without anything typed in the .htaccess file, but when anything is typed, including the URL code thing I have to put into it, my MyBB directory disappears from my webpage (But I can still see it in cpanel's filemanager)
So... What now?...
 
Last edited:

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Hello,

Normally we do not ask for account information such as passwords, but I feel that in this case it'd be easier for me to log into your account and attempt to fix the problem. If you are willing to do this, can you please email or PM me your cPanel password? If you are sending it via email, send it to my staff email shown below in my signature.

If you are not willing to do this, we can continue with trying out various things until something works.
 
Status
Not open for further replies.
Top